Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(theme): gestion du dark mode sur les widgets #6275

Merged
merged 6 commits into from
Nov 26, 2024
Merged

Conversation

maxgfr
Copy link
Member

@maxgfr maxgfr commented Nov 12, 2024

fix #6269

@maxgfr
Copy link
Member Author

maxgfr commented Nov 12, 2024

Comment on lines +16 to +20
const { setIsDark } = useIsDark();

useEffect(() => {
setIsDark(false);
}, []);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A retirer, car cela réinitialise les préférences des utilisateurs. Ce n'est pas la bonne approche

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

du coup plus besoin de ça ?

return (
<html {...getHtmlAttributes({ defaultColorScheme, lang })}>
<head>
{defaultColorScheme === "light" && <StartDsfrLight />}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

est-ce qu"on peut faire un seul if/else pour que les 3 ne soient pas évalués à chaque fois ?

@@ -10,8 +9,8 @@ declare module "@codegouvfr/react-dsfr/next-appdir" {
}
}

startReactDsfr({ defaultColorScheme, Link, doCheckNonce: true });
startReactDsfr({ defaultColorScheme: "dark", Link, doCheckNonce: true });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

il est utile celui la ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je ne pense pas, après c'est un truc interne à react-dsfr

je te dirai qu'en théorie non mais c'est pour que ça soit synchroniser au niveau du composant de manière logique de dark / light theme

je pense on peut laisser comme ça

Copy link
Contributor

@carolineBda carolineBda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai mis des commentaires pas bloquant

Copy link

@maxgfr maxgfr merged commit a59bb29 into dev Nov 26, 2024
23 checks passed
@maxgfr maxgfr deleted the maxgfr/icon-theme branch November 26, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Désactiver le darkMode sur les widgets
4 participants