f14ad61bd0
* build: move build process and excalidraw-app dependencies in its own package.json * fix * fix public path * move bug-issue-template to excalidraw-app * make env vars accessible in excalidraw app * update build script * install when building * add ts ignore * fix build-version script * update config in vercel.json * add vercel config for example * fix vercel config * update install script in vercel * update install script in lint.yml * update install script in test workflows * push locales to locales folder pwa * add favicons to manifest * move react to peer deps in editor * fix ts * Enable vite intellisense * add global.d.ts for excalidraw-app * remove console.log * remove react, react-dom and vite from excalidraw-app deps * increase size limit
27 lines
754 B
TypeScript
27 lines
754 B
TypeScript
import { useSetAtom } from "jotai";
|
|
import React from "react";
|
|
import { appLangCodeAtom } from "../App";
|
|
import { useI18n } from "../../src/i18n";
|
|
import { languages } from "../../src/i18n";
|
|
|
|
export const LanguageList = ({ style }: { style?: React.CSSProperties }) => {
|
|
const { t, langCode } = useI18n();
|
|
const setLangCode = useSetAtom(appLangCodeAtom);
|
|
|
|
return (
|
|
<select
|
|
className="dropdown-select dropdown-select__language"
|
|
onChange={({ target }) => setLangCode(target.value)}
|
|
value={langCode}
|
|
aria-label={t("buttons.selectLanguage")}
|
|
style={style}
|
|
>
|
|
{languages.map((lang) => (
|
|
<option key={lang.code} value={lang.code}>
|
|
{lang.label}
|
|
</option>
|
|
))}
|
|
</select>
|
|
);
|
|
};
|