-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99bb419
commit 3dcaf41
Showing
10 changed files
with
228 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"login": "Anmelden" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"login": "Login" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import TranslationsProvider from '@/src/components/translation-provider/TranslationsProvider'; | ||
import initTranslations from '@i18n'; | ||
import { FunctionComponent } from 'react'; | ||
|
||
interface HomeProps { | ||
params: { | ||
locale: string; | ||
}; | ||
} | ||
|
||
const i18nNamespaces = ['login']; | ||
|
||
const Home: FunctionComponent<HomeProps> = async ({ params: { locale } }) => { | ||
const { t, resources } = await initTranslations(locale, i18nNamespaces); | ||
|
||
return ( | ||
<TranslationsProvider resources={resources} locale={locale} namespaces={i18nNamespaces}> | ||
<h1>{t('login:login')}</h1> | ||
</TranslationsProvider> | ||
); | ||
}; | ||
|
||
export default Home; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
import { NextUIProvider } from '@nextui-org/react'; | ||
import { ThemeProvider } from 'next-themes'; | ||
import { FunctionComponent, PropsWithChildren } from 'react'; | ||
|
||
const Providers: FunctionComponent<PropsWithChildren> = ({ children }) => { | ||
return <NextUIProvider>{children}</NextUIProvider>; | ||
return ( | ||
<NextUIProvider> | ||
<ThemeProvider attribute="class" defaultTheme="dark"> | ||
{children} | ||
</ThemeProvider> | ||
</NextUIProvider> | ||
); | ||
}; | ||
|
||
export default Providers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use client'; | ||
|
||
import { Button } from '@nextui-org/react'; | ||
import { useTheme } from 'next-themes'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
export function ThemeSwitcher(): React.ReactNode { | ||
const [mounted, setMounted] = useState(false); | ||
const { theme, setTheme } = useTheme(); | ||
|
||
useEffect(() => { | ||
setMounted(true); | ||
}, []); | ||
|
||
if (!mounted) return null; | ||
|
||
return ( | ||
<div> | ||
The current theme is: {theme} | ||
<Button onClick={() => setTheme('light')}>Light Mode</Button> | ||
<Button onClick={() => setTheme('dark')}>Dark Mode</Button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters