diff --git a/src/components/layout/LangDropdown/LangDropdown.tsx b/src/components/layout/LangDropdown/LangDropdown.tsx new file mode 100644 index 0000000..42bd84d --- /dev/null +++ b/src/components/layout/LangDropdown/LangDropdown.tsx @@ -0,0 +1,51 @@ +import type { Component } from 'solid-js' +import { createSignal, For } from 'solid-js' +import { Motion } from '@motionone/solid' + +import { useLocalStorage } from '../../../hooks/useLocalStorage' +import { AnimateView, Flag } from '../../design' +import { OutSideEventHandler } from '../OutSideEventHandler' +import { Animation, SUPPORTED_LANGS } from '../../../config' + +export const LangDropdown: Component = () => { + const { lang, setLang } = useLocalStorage() + + let ref: HTMLDivElement | undefined + const [active, setActive] = createSignal(false) + + return ( + { + return setActive(false) + }}> +
{ + return setActive(!active()) + }}> + Selected Lang: +
+ + + + {(lang, index) => { + return ( + { + setActive(false) + return setLang(lang.domain) + }}> + + + ) + }} + + +
+ ) +} diff --git a/src/components/layout/LangDropdown/index.ts b/src/components/layout/LangDropdown/index.ts new file mode 100644 index 0000000..17427cd --- /dev/null +++ b/src/components/layout/LangDropdown/index.ts @@ -0,0 +1 @@ +export * from './LangDropdown'