File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
packages/i18n/src/locales Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import type { SimpleLocaleConfig } from '@node-core/ui-components/types';
1111import dynamic from 'next/dynamic' ;
1212import { useLocale , useTranslations } from 'next-intl' ;
1313import { useTheme } from 'next-themes' ;
14+ import { useState , useEffect } from 'react' ;
1415import type { FC } from 'react' ;
1516
1617import Link from '#site/components/Link' ;
@@ -35,12 +36,16 @@ const WithNavBar: FC = () => {
3536 const t = useTranslations ( ) ;
3637
3738 const locale = useLocale ( ) ;
39+ const [ mounted , setMounted ] = useState ( false ) ;
40+
41+ useEffect ( ( ) => setMounted ( true ) , [ ] ) ;
3842
3943 const toggleCurrentTheme = ( ) =>
4044 setTheme ( resolvedTheme === 'dark' ? 'light' : 'dark' ) ;
4145
42- const themeToggleAriaLabel =
43- resolvedTheme === 'dark'
46+ const themeToggleAriaLabel = ! mounted
47+ ? t ( 'components.common.themeToggle.loading' )
48+ : resolvedTheme === 'dark'
4449 ? t ( 'components.common.themeToggle.light' )
4550 : t ( 'components.common.themeToggle.dark' ) ;
4651
Original file line number Diff line number Diff line change 229229 "label" : " Choose Language"
230230 },
231231 "themeToggle" : {
232+ "loading" : " Loading theme label..." ,
232233 "light" : " Switch to Light Mode" ,
233234 "dark" : " Switch to Dark Mode"
234235 }
You can’t perform that action at this time.
0 commit comments