chore: add beta badge component

This commit is contained in:
steven 2023-09-06 00:06:04 +08:00
parent 5e6190b181
commit cff6c54b52
2 changed files with 18 additions and 2 deletions

View File

@ -0,0 +1,9 @@
const BetaBadge = () => {
return (
<div className="text-xs border px-1 text-gray-500 bg-gray-100 rounded-full">
<span>Beta</span>
</div>
);
};
export default BetaBadge;

View File

@ -2,6 +2,7 @@ import { Option, Select } from "@mui/joy";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { UserSetting, UserSetting_ColorTheme, UserSetting_Locale } from "@/types/proto/api/v2/user_setting_service_pb"; import { UserSetting, UserSetting_ColorTheme, UserSetting_Locale } from "@/types/proto/api/v2/user_setting_service_pb";
import useUserStore from "../../stores/v1/user"; import useUserStore from "../../stores/v1/user";
import BetaBadge from "../BetaBadge";
const PreferenceSection: React.FC = () => { const PreferenceSection: React.FC = () => {
const { t } = useTranslation(); const { t } = useTranslation();
@ -65,7 +66,10 @@ const PreferenceSection: React.FC = () => {
<div className="w-full flex flex-col justify-start items-start gap-y-2"> <div className="w-full flex flex-col justify-start items-start gap-y-2">
<p className="text-base font-semibold leading-6 text-gray-900">Preference</p> <p className="text-base font-semibold leading-6 text-gray-900">Preference</p>
<div className="w-full flex flex-row justify-between items-center"> <div className="w-full flex flex-row justify-between items-center">
<div className="flex flex-row justify-start items-center gap-x-1">
<span>{t("common.language")}</span> <span>{t("common.language")}</span>
<BetaBadge />
</div>
<Select defaultValue={language} onChange={(_, value) => handleSelectLanguage(value as UserSetting_Locale)}> <Select defaultValue={language} onChange={(_, value) => handleSelectLanguage(value as UserSetting_Locale)}>
{languageOptions.map((option) => { {languageOptions.map((option) => {
return ( return (
@ -77,7 +81,10 @@ const PreferenceSection: React.FC = () => {
</Select> </Select>
</div> </div>
<div className="w-full flex flex-row justify-between items-center"> <div className="w-full flex flex-row justify-between items-center">
<div className="flex flex-row justify-start items-center gap-x-1">
<span>Color Theme</span> <span>Color Theme</span>
<BetaBadge />
</div>
<Select defaultValue={colorTheme} onChange={(_, value) => handleSelectColorTheme(value as UserSetting_ColorTheme)}> <Select defaultValue={colorTheme} onChange={(_, value) => handleSelectColorTheme(value as UserSetting_ColorTheme)}>
{colorThemeOptions.map((option) => { {colorThemeOptions.map((option) => {
return ( return (