diff --git a/src/components/Layouts/Header.tsx b/src/components/Layouts/Header.tsx index 85d89df..fefc7e6 100644 --- a/src/components/Layouts/Header.tsx +++ b/src/components/Layouts/Header.tsx @@ -18,7 +18,7 @@ import { useWindowWidth } from '../../hooks/useWindowWidth'; export function Header() { const [menuOpen, setMenuOpen] = useState(false); - const { value: lang } = useLanguageStore(); + const { lang } = useLanguageStore(); const setModal = useModalStore(state => state.setModal); const menuRef = useRef(null); @@ -86,8 +86,8 @@ export function Header() { > Оставить заявку - - + + @@ -109,19 +109,19 @@ function BurgerAnchor({ ); } -function ChooseLang({ lang }: { lang: 'RU' | 'EN' }) { - const { updateLang, value } = useLanguageStore(); +function ChooseLang({ currentLang }: { currentLang: 'RU' | 'EN' }) { + const { setLang, lang } = useLanguageStore(); return ( ); } @@ -150,8 +150,8 @@ function LangToggler({ lang }: { lang: Lang }) { animate={{ opacity: +open }} transition={{ duration: 0.2 }} > - - + + ); diff --git a/src/components/icons/LogoIcon.tsx b/src/components/icons/LogoIcon.tsx index 97f37aa..fb74e9b 100644 --- a/src/components/icons/LogoIcon.tsx +++ b/src/components/icons/LogoIcon.tsx @@ -9,8 +9,8 @@ export default function LogoIcon({ className = '' }: { className?: string }) { className={className} > @@ -22,67 +22,67 @@ export default function LogoIcon({ className = '' }: { className?: string }) { opacity="0.3" d="M17.6704 8.17514C18.4081 8.0323 19.1698 7.95752 19.9489 7.95752V0H19.9222C18.3448 0 16.8103 0.18501 15.3388 0.534682L17.6704 8.17514Z" fill="black" - fill-opacity="0.6" + fillOpacity="0.6" /> - - + + diff --git a/src/components/icons/LogoTextIcon.tsx b/src/components/icons/LogoTextIcon.tsx deleted file mode 100644 index 06511f4..0000000 --- a/src/components/icons/LogoTextIcon.tsx +++ /dev/null @@ -1,109 +0,0 @@ -export default function LogoTextIcon({ - className = '', -}: { - className?: string; -}) { - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); -} diff --git a/src/components/icons/LogoWithTextIcon.tsx b/src/components/icons/LogoWithTextIcon.tsx index 0414ccd..42b1bff 100644 --- a/src/components/icons/LogoWithTextIcon.tsx +++ b/src/components/icons/LogoWithTextIcon.tsx @@ -13,8 +13,8 @@ export default function LogoWithTextIcon({ className={className} > @@ -26,67 +26,67 @@ export default function LogoWithTextIcon({ opacity="0.3" d="M17.6704 8.17514C18.4081 8.0323 19.1698 7.95752 19.9489 7.95752V0H19.9222C18.3448 0 16.8103 0.18501 15.3388 0.534682L17.6704 8.17514Z" fill="black" - fill-opacity="0.6" + fillOpacity="0.6" /> - - + + - - + + - - + + - - + + - - + + - - + + - - + + diff --git a/src/store/languageStore.ts b/src/store/languageStore.ts index 9076ca4..dbcca67 100644 --- a/src/store/languageStore.ts +++ b/src/store/languageStore.ts @@ -4,24 +4,19 @@ import { devtools, persist } from 'zustand/middleware'; export type Lang = 'RU' | 'EN'; export const useLanguageStore = create<{ - value: Lang; - updateLang: (lang: Lang) => void; + lang: Lang; + setLang: (lang: Lang) => void; }>()( devtools( persist( set => ({ - value: JSON.parse(localStorage.getItem('lang') ?? '{}').state ?? 'RU', - updateLang: (lang: Lang) => { - localStorage.setItem( - 'lang', - JSON.stringify({ state: { value: lang } }), - ); - set({ value: lang }); + lang: 'RU', + setLang: (lang: Lang) => { + set({ lang: lang }); }, }), { name: 'lang', - partialize: state => ({ value: state.value }), }, ), ),