Skip to content

Commit 83275bb

Browse files
committed
fix: update language switch disable condition in HeaderAction component
- Removed the isEssential check from the language switch disable condition, ensuring that the language option is only disabled based on supported locales. This change improves the user experience by allowing users to switch languages more freely when supported.
1 parent be56283 commit 83275bb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/components/Layout/HeaderAction.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { Locale, BuildType } from "shared/interface";
2121
import { ActionButton } from "components/Card/FeedbackSection/components";
2222
import { Link } from "gatsby";
2323
import { useIsAutoTranslation } from "shared/useIsAutoTranslation";
24-
import { useCloudPlan } from "shared/useCloudPlan";
2524

2625
const useTiDBAIStatus = () => {
2726
const [showTiDBAIButton, setShowTiDBAIButton] = React.useState(true);
@@ -124,7 +123,6 @@ const LangSwitch = (props: {
124123
supportedLocales: Locale[];
125124
}) => {
126125
const { supportedLocales } = props;
127-
const { isEssential } = useCloudPlan();
128126

129127
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
130128

@@ -225,7 +223,7 @@ const LangSwitch = (props: {
225223
onClick={toggleLanguage(Locale.ja)}
226224
disableRipple
227225
selected={language === Locale.ja}
228-
disabled={!supportedLocales.includes(Locale.ja) || isEssential}
226+
disabled={!supportedLocales.includes(Locale.ja)}
229227
>
230228
<Typography component="span" color={theme.palette.carbon[900]}>
231229
<Trans i18nKey="lang.ja" />

0 commit comments

Comments
 (0)