Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
14 changed files
with
171 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Option, Select } from "@mui/joy"; | ||
import { FC } from "react"; | ||
import Icon from "./Icon"; | ||
|
||
interface Props { | ||
value: Locale; | ||
onChange: (locale: Locale) => void; | ||
className?: string; | ||
} | ||
|
||
const LocaleSelect: FC<Props> = (props: Props) => { | ||
const { onChange, value, className } = props; | ||
|
||
const handleSelectChange = async (locale: Locale) => { | ||
onChange(locale); | ||
}; | ||
|
||
return ( | ||
<Select | ||
className={`!min-w-[10rem] w-auto whitespace-nowrap ${className ?? ""}`} | ||
startDecorator={<Icon.Globe className="w-4 h-auto" />} | ||
value={value} | ||
onChange={(_, value) => handleSelectChange(value as Locale)} | ||
> | ||
<Option value="en">English</Option> | ||
<Option value="zh">中文</Option> | ||
<Option value="vi">Tiếng Việt</Option> | ||
<Option value="fr">French</Option> | ||
<Option value="nl">Nederlands</Option> | ||
<Option value="sv">Svenska</Option> | ||
<Option value="de">German</Option> | ||
<Option value="es">Español</Option> | ||
</Select> | ||
); | ||
}; | ||
|
||
export default LocaleSelect; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.