Skip to content

Commit 23d6fa2

Browse files
committed
refactor: remove unused useCloudPlan import and simplify language switch logic
- Eliminated the useCloudPlan import from HeaderAction, as it was no longer needed. - Updated the language switch logic to remove dependency on the cloud plan, enhancing clarity and maintainability.
1 parent 7e8f8b5 commit 23d6fa2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/components/Layout/HeaderAction.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ import TranslateIcon from "media/icons/globe-02.svg";
1717

1818
import Search from "components/Search";
1919

20-
import { Locale, BuildType, PathConfig, Repo } from "shared/interface";
20+
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);
@@ -129,7 +128,6 @@ const LangSwitch = (props: {
129128

130129
const theme = useTheme();
131130
const { language, changeLanguage } = useI18next();
132-
const { isClassic } = useCloudPlan();
133131

134132
const open = Boolean(anchorEl);
135133
const handleClick = (event: React.MouseEvent<HTMLElement>) => {
@@ -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) || !isClassic}
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)