Skip to content

Commit

Permalink
chore: remove check for i81n feature flag (#1093)
Browse files Browse the repository at this point in the history
  • Loading branch information
chidg authored Sep 28, 2023
1 parent 91895a1 commit 54c4316
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 27 deletions.
1 change: 0 additions & 1 deletion apps/extension/src/core/domains/app/store.features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ if (DEBUG && Browser.extension.getBackgroundPage() === window) {
BUY_CRYPTO: true, // nav buttons + button in fund wallet component
LINK_TX_HISTORY: true,
LINK_STAKING: true,
I18N: true,
USE_ONFINALITY_API_KEY: false,
TEST_VARIANT: "VARIANT1",
}
Expand Down
1 change: 0 additions & 1 deletion apps/extension/src/core/domains/app/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export type FeatureVariants = Partial<{
BUY_CRYPTO: boolean
LINK_TX_HISTORY: boolean
LINK_STAKING: boolean
I18N: boolean
USE_ONFINALITY_API_KEY: boolean
TEST_VARIANT: "VARIANT1" | "VARIANT2" // keep this one for string type checking
}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from "@talismn/icons"
import { AvatarTypeSelect } from "@ui/domains/Settings/AvatarTypeSelect"
import { useAppState } from "@ui/hooks/useAppState"
import { useIsFeatureEnabled } from "@ui/hooks/useFeatures"
import { useSetting } from "@ui/hooks/useSettings"
import { Trans, useTranslation } from "react-i18next"
import { CtaButton, Toggle, Tooltip, TooltipContent, TooltipTrigger } from "talisman-ui"
Expand All @@ -24,7 +23,6 @@ export const GeneralPage = () => {
const [hasSpiritKey] = useAppState("hasSpiritKey")
const [useTestnets, setUseTestnets] = useSetting("useTestnets")
const [hideBalances, setHideBalances] = useSetting("hideBalances")
const i18nEnabled = useIsFeatureEnabled("I18N")
const [identiconType, setIdenticonType] = useSetting("identiconType")
const [allowNotifications, setAllowNotifications] = useSetting("allowNotifications")
const [spiritClanFeatures, setSpiritClanFeatures] = useSetting("spiritClanFeatures")
Expand Down Expand Up @@ -100,15 +98,13 @@ export const GeneralPage = () => {
>
<Toggle checked={hideBalances} onChange={(e) => setHideBalances(e.target.checked)} />
</Setting>
{i18nEnabled && (
<CtaButton
iconLeft={FlagIcon}
iconRight={ChevronRightIcon}
title={t("Language")}
subtitle={t("Change the wallet display language")}
to={`/settings/language`}
/>
)}
<CtaButton
iconLeft={FlagIcon}
iconRight={ChevronRightIcon}
title={t("Language")}
subtitle={t("Change the wallet display language")}
to={`/settings/language`}
/>
<CtaButton
iconLeft={DollarSignIcon}
iconRight={ChevronRightIcon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import { languages } from "@core/i18nConfig"
import { HeaderBlock } from "@talisman/components/HeaderBlock"
import { Spacer } from "@talisman/components/Spacer"
import { CheckIcon } from "@talismn/icons"
import { useIsFeatureEnabled } from "@ui/hooks/useFeatures"
import { useEffect } from "react"
import { useTranslation } from "react-i18next"
import { useNavigate } from "react-router-dom"

import { DashboardLayout } from "../../layout/DashboardLayout"

Expand Down Expand Up @@ -35,20 +32,10 @@ const LanguageButton = ({

export const LanguagePage = () => {
const { t, i18n } = useTranslation("admin")
const i18nEnabled = useIsFeatureEnabled("I18N")
const navigate = useNavigate()

const currentLang = i18n.language
const changeLang = (lang?: keyof typeof languages) => lang && i18n.changeLanguage(lang)

// TODO remove this useEffect when i18n is enabled by default
useEffect(() => {
if (!i18nEnabled) {
// redirect to general settings page
navigate("/settings/general")
}
}, [i18nEnabled, navigate])

return (
<DashboardLayout centered withBack backTo="/settings/general">
<HeaderBlock title={t("Language")} text={t("Choose your preferred language")} />
Expand Down
1 change: 0 additions & 1 deletion apps/extension/tests/mocks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jest.mock("@core/util/getConfig", () => ({
BUY_CRYPTO: true, // nav buttons + button in fund wallet component
LINK_TX_HISTORY: true,
LINK_STAKING: true,
I18N: true,
},
})
),
Expand Down

0 comments on commit 54c4316

Please sign in to comment.