-
Notifications
You must be signed in to change notification settings - Fork 22
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
Conversation
A priori la gestion SSR est bien géré ici : https://github.com/codegouvfr/react-dsfr/blob/c5353f61a971357adcc7b21ef56787a6429726e5/src/useIsDark/index.ts#L6 |
const { setIsDark } = useIsDark(); | ||
|
||
useEffect(() => { | ||
setIsDark(false); | ||
}, []); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 />} |
There was a problem hiding this comment.
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 }); |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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
There was a problem hiding this 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
🎉 Deployment for commit 69a75e3 : IngressesDocker images
|
fix #6269