1- import classNames from " classnames" ;
2- import { useEffect } from " react" ;
3- import styles from " ./Layout.module.css" ;
1+ import classNames from ' classnames' ;
2+ import { useEffect } from ' react' ;
3+ import styles from ' ./Layout.module.css' ;
44
55export function GradientBackground ( { variant, className } ) {
66 const classes = classNames (
77 {
8- [ styles . colorBackground ] : variant === " large" ,
9- [ styles . colorBackgroundBottom ] : variant === " small" ,
8+ [ styles . colorBackground ] : variant === ' large' ,
9+ [ styles . colorBackgroundBottom ] : variant === ' small' ,
1010 } ,
1111 className
1212 ) ;
@@ -16,27 +16,27 @@ export function GradientBackground({ variant, className }) {
1616
1717export default function Layout ( { children } ) {
1818 const setAppTheme = ( ) => {
19- const darkMode = localStorage . getItem ( " theme" ) === " dark" ;
20- const lightMode = localStorage . getItem ( " theme" ) === " light" ;
19+ const darkMode = localStorage . getItem ( ' theme' ) === ' dark' ;
20+ const lightMode = localStorage . getItem ( ' theme' ) === ' light' ;
2121
2222 if ( darkMode ) {
23- document . documentElement . classList . add ( " dark" ) ;
23+ document . documentElement . classList . add ( ' dark' ) ;
2424 } else if ( lightMode ) {
25- document . documentElement . classList . remove ( " dark" ) ;
25+ document . documentElement . classList . remove ( ' dark' ) ;
2626 }
2727 return ;
2828 } ;
2929
3030 const handleSystemThemeChange = ( ) => {
31- var darkQuery = window . matchMedia ( " (prefers-color-scheme: dark)" ) ;
31+ var darkQuery = window . matchMedia ( ' (prefers-color-scheme: dark)' ) ;
3232
3333 darkQuery . onchange = ( e ) => {
3434 if ( e . matches ) {
35- document . documentElement . classList . add ( " dark" ) ;
36- localStorage . setItem ( " theme" , " dark" ) ;
35+ document . documentElement . classList . add ( ' dark' ) ;
36+ localStorage . setItem ( ' theme' , ' dark' ) ;
3737 } else {
38- document . documentElement . classList . remove ( " dark" ) ;
39- localStorage . setItem ( " theme" , " light" ) ;
38+ document . documentElement . classList . remove ( ' dark' ) ;
39+ localStorage . setItem ( ' theme' , ' light' ) ;
4040 }
4141 } ;
4242 } ;
0 commit comments