refactor dropdown to select

This commit is contained in:
Chris Kruining 2025-01-07 13:14:35 +01:00
parent 57bb6ec2d9
commit 6d69566e1a
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
3 changed files with 179 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import { Component } from "solid-js";
import { internal_useI18n } from "./context";
import { locales } from "./constants";
import { Dropdown } from "~/components/dropdown";
import { Select } from "~/components/select";
import { Dynamic } from "solid-js/web";
import css from './picker.module.css';
@ -10,7 +10,7 @@ interface LocalePickerProps { }
export const LocalePicker: Component<LocalePickerProps> = (props) => {
const { locale, setLocale } = internal_useI18n();
return <Dropdown
return <Select
id="locale-picker"
class={css.box}
value={locale()}
@ -19,5 +19,5 @@ export const LocalePicker: Component<LocalePickerProps> = (props) => {
showCaret={false}
>
{(locale, { flag, label }) => <Dynamic component={flag} lang={locale} aria-label={label} class={css.flag} />}
</Dropdown>
</Select>
};