refactor: standardize quotation marks in pnpm-lock.yaml and improve code formatting across various components; enhance readability and maintain consistency in code style
This commit is contained in:
@@ -40,43 +40,50 @@ const DEFAULT_BACKGROUNDS: Array<{
|
||||
{
|
||||
value: "default",
|
||||
label: "Neutre",
|
||||
preview: "linear-gradient(135deg, oklch(0.985 0 0) 0%, oklch(0.97 0.005 260) 50%, oklch(0.985 0 0) 100%)",
|
||||
preview:
|
||||
"linear-gradient(135deg, oklch(0.985 0 0) 0%, oklch(0.97 0.005 260) 50%, oklch(0.985 0 0) 100%)",
|
||||
description: "Fond neutre et élégant",
|
||||
},
|
||||
{
|
||||
value: "gradient-blue",
|
||||
label: "Océan",
|
||||
preview: "linear-gradient(135deg, oklch(0.95 0.03 230) 0%, oklch(0.88 0.08 225) 50%, oklch(0.78 0.12 220) 100%)",
|
||||
preview:
|
||||
"linear-gradient(135deg, oklch(0.95 0.03 230) 0%, oklch(0.88 0.08 225) 50%, oklch(0.78 0.12 220) 100%)",
|
||||
description: "Dégradé bleu apaisant",
|
||||
},
|
||||
{
|
||||
value: "gradient-purple",
|
||||
label: "Améthyste",
|
||||
preview: "linear-gradient(135deg, oklch(0.95 0.04 300) 0%, oklch(0.88 0.1 295) 50%, oklch(0.78 0.15 290) 100%)",
|
||||
preview:
|
||||
"linear-gradient(135deg, oklch(0.95 0.04 300) 0%, oklch(0.88 0.1 295) 50%, oklch(0.78 0.15 290) 100%)",
|
||||
description: "Dégradé violet sophistiqué",
|
||||
},
|
||||
{
|
||||
value: "gradient-green",
|
||||
label: "Forêt",
|
||||
preview: "linear-gradient(135deg, oklch(0.95 0.04 160) 0%, oklch(0.88 0.1 155) 50%, oklch(0.78 0.14 150) 100%)",
|
||||
preview:
|
||||
"linear-gradient(135deg, oklch(0.95 0.04 160) 0%, oklch(0.88 0.1 155) 50%, oklch(0.78 0.14 150) 100%)",
|
||||
description: "Dégradé vert naturel",
|
||||
},
|
||||
{
|
||||
value: "gradient-orange",
|
||||
label: "Aurore",
|
||||
preview: "linear-gradient(135deg, oklch(0.97 0.03 80) 0%, oklch(0.92 0.08 60) 50%, oklch(0.85 0.14 45) 100%)",
|
||||
preview:
|
||||
"linear-gradient(135deg, oklch(0.97 0.03 80) 0%, oklch(0.92 0.08 60) 50%, oklch(0.85 0.14 45) 100%)",
|
||||
description: "Dégradé orange chaleureux",
|
||||
},
|
||||
{
|
||||
value: "solid-light",
|
||||
label: "Lumineux",
|
||||
preview: "linear-gradient(135deg, oklch(1 0 0) 0%, oklch(0.98 0.005 260) 100%)",
|
||||
preview:
|
||||
"linear-gradient(135deg, oklch(1 0 0) 0%, oklch(0.98 0.005 260) 100%)",
|
||||
description: "Fond blanc épuré",
|
||||
},
|
||||
{
|
||||
value: "solid-dark",
|
||||
label: "Minuit",
|
||||
preview: "linear-gradient(135deg, oklch(0.18 0.02 260) 0%, oklch(0.08 0.015 250) 100%)",
|
||||
preview:
|
||||
"linear-gradient(135deg, oklch(0.18 0.02 260) 0%, oklch(0.08 0.015 250) 100%)",
|
||||
description: "Fond sombre immersif",
|
||||
},
|
||||
];
|
||||
@@ -89,14 +96,14 @@ export function BackgroundCard() {
|
||||
|
||||
const currentSettings = useMemo<BackgroundSettings>(
|
||||
() => backgroundSettings || { type: "default" },
|
||||
[backgroundSettings]
|
||||
[backgroundSettings],
|
||||
);
|
||||
|
||||
const [customImageUrl, setCustomImageUrl] = useState(
|
||||
currentSettings.customImageUrl || ""
|
||||
currentSettings.customImageUrl || "",
|
||||
);
|
||||
const [showCustomInput, setShowCustomInput] = useState(
|
||||
currentSettings.type === "custom-image"
|
||||
currentSettings.type === "custom-image",
|
||||
);
|
||||
|
||||
// Synchroniser customImageUrl avec les settings
|
||||
@@ -112,7 +119,7 @@ export function BackgroundCard() {
|
||||
const applyBackground = (settings: BackgroundSettings) => {
|
||||
const root = document.documentElement;
|
||||
const pageBackground = document.querySelector(
|
||||
".page-background"
|
||||
".page-background",
|
||||
) as HTMLElement;
|
||||
|
||||
if (!pageBackground) return;
|
||||
@@ -126,14 +133,14 @@ export function BackgroundCard() {
|
||||
"bg-gradient-orange",
|
||||
"bg-solid-light",
|
||||
"bg-solid-dark",
|
||||
"bg-custom-image"
|
||||
"bg-custom-image",
|
||||
);
|
||||
|
||||
if (settings.type === "custom-image" && settings.customImageUrl) {
|
||||
pageBackground.classList.add("bg-custom-image");
|
||||
root.style.setProperty(
|
||||
"--custom-background-image",
|
||||
`url(${settings.customImageUrl})`
|
||||
`url(${settings.customImageUrl})`,
|
||||
);
|
||||
} else {
|
||||
pageBackground.classList.add(`bg-${settings.type || "default"}`);
|
||||
@@ -142,7 +149,7 @@ export function BackgroundCard() {
|
||||
|
||||
// Déclencher un événement personnalisé pour notifier les autres composants
|
||||
window.dispatchEvent(
|
||||
new CustomEvent("background-changed", { detail: settings })
|
||||
new CustomEvent("background-changed", { detail: settings }),
|
||||
);
|
||||
};
|
||||
|
||||
@@ -222,7 +229,7 @@ export function BackgroundCard() {
|
||||
"relative flex flex-col items-center justify-center p-4 rounded-lg border-2 cursor-pointer transition-all",
|
||||
currentSettings.type === bg.value
|
||||
? "border-primary bg-primary/5"
|
||||
: "border-border hover:border-primary/50"
|
||||
: "border-border hover:border-primary/50",
|
||||
)}
|
||||
>
|
||||
<RadioGroupItem
|
||||
@@ -245,7 +252,7 @@ export function BackgroundCard() {
|
||||
"relative flex flex-col items-center justify-center p-4 rounded-lg border-2 cursor-pointer transition-all",
|
||||
currentSettings.type === "custom-image"
|
||||
? "border-primary bg-primary/5"
|
||||
: "border-border hover:border-primary/50"
|
||||
: "border-border hover:border-primary/50",
|
||||
)}
|
||||
>
|
||||
<RadioGroupItem
|
||||
|
||||
Reference in New Issue
Block a user