added admin layout

This commit is contained in:
2024-04-27 00:40:27 +03:00
parent f17a002ac6
commit db66161d81
15 changed files with 566 additions and 36 deletions

View File

@@ -3,18 +3,18 @@
import { useChangeLocale, useCurrentLocale } from '@/locales/client'
import { LC, type loc } from '@/config/locales'
import { ChangeEvent } from 'react'
import styles from '@/styles/locale-switcher.module.scss'
export default function LocaleSwitcher () {
const changeLocale = useChangeLocale()
const locale = useCurrentLocale()
const selectHandler = (e: ChangeEvent<HTMLSelectElement>) => changeLocale(e.target.value as loc)
// {cn(styles['yo-locale-switcher'], 'pr-4')}
return (//@ts-ignore
<select className={styles['yo-locale-switcher']} aria-label="Switch language"
<select className="appearance-none bg-transparent block text-center text-xs text-sky-600 py-1 px-2 my-2 mx-0 outline-0"
aria-label="Switch locale"
defaultValue={locale} onChange={selectHandler}
>
{LC.map(item => (<option key={item.iso} value={item.code}>
{LC.map(item => (<option key={item.iso} value={item.code} className="pr-4">
{item.iso.toUpperCase()}
</option>))}
</select>)