|
|
@ -1,6 +1,6 @@
|
|
|
|
import { useI18n } from 'next-localization';
|
|
|
|
import { useI18n } from 'next-localization';
|
|
|
|
|
|
|
|
import { useRouter } from 'next/router';
|
|
|
|
import { useTheme } from 'next-themes';
|
|
|
|
import { useTheme } from 'next-themes';
|
|
|
|
import { GetStaticProps } from 'next';
|
|
|
|
|
|
|
|
import Link from 'next/link';
|
|
|
|
import Link from 'next/link';
|
|
|
|
|
|
|
|
|
|
|
|
import { BiMoon } from 'react-icons/bi';
|
|
|
|
import { BiMoon } from 'react-icons/bi';
|
|
|
@ -10,6 +10,28 @@ import { FC } from 'react';
|
|
|
|
|
|
|
|
|
|
|
|
import styles from './Navbar.module.scss';
|
|
|
|
import styles from './Navbar.module.scss';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const LanguageSelector: FC = () => {
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const path = router.pathname;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<select className={styles.select} defaultValue={router.locale}>
|
|
|
|
|
|
|
|
{router.locales.map((locale) => (
|
|
|
|
|
|
|
|
<option
|
|
|
|
|
|
|
|
key={locale}
|
|
|
|
|
|
|
|
onClick={() => {
|
|
|
|
|
|
|
|
router.push(path, path, { locale });
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
value={locale}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{locale.toUpperCase()}
|
|
|
|
|
|
|
|
</option>
|
|
|
|
|
|
|
|
))}
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const Navbar: FC = () => {
|
|
|
|
const Navbar: FC = () => {
|
|
|
|
const { t } = useI18n();
|
|
|
|
const { t } = useI18n();
|
|
|
|
|
|
|
|
|
|
|
@ -35,10 +57,7 @@ const Navbar: FC = () => {
|
|
|
|
<BiMoon onClick={switchTheme} className={styles.moon} />
|
|
|
|
<BiMoon onClick={switchTheme} className={styles.moon} />
|
|
|
|
<ImSun onClick={switchTheme} className={styles.sun} />
|
|
|
|
<ImSun onClick={switchTheme} className={styles.sun} />
|
|
|
|
|
|
|
|
|
|
|
|
<select className={styles.select}>
|
|
|
|
<LanguageSelector />
|
|
|
|
<option value="nl">NL</option>
|
|
|
|
|
|
|
|
<option value="en">EN</option>
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -46,12 +65,4 @@ const Navbar: FC = () => {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export const getStaticProps: GetStaticProps = async ({ locale }) => {
|
|
|
|
|
|
|
|
const { default: lngDict = {} } = await import(`../locales/${locale}.json`);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
props: { lngDict },
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default Navbar;
|
|
|
|
export default Navbar;
|
|
|
|