From b2c5f175781eda327e01259504cec7007f029f41 Mon Sep 17 00:00:00 2001 From: Thunnini Date: Fri, 12 Apr 2024 18:28:51 +0900 Subject: [PATCH] Add text to the bottom tabs --- packages/extension/src/bottom-tabs.tsx | 73 ++++++++++++++++++------ packages/extension/src/index.tsx | 12 ++++ packages/extension/src/languages/en.json | 4 ++ packages/extension/src/languages/ko.json | 4 ++ 4 files changed, 76 insertions(+), 17 deletions(-) diff --git a/packages/extension/src/bottom-tabs.tsx b/packages/extension/src/bottom-tabs.tsx index 5b72541975..9a238e5005 100644 --- a/packages/extension/src/bottom-tabs.tsx +++ b/packages/extension/src/bottom-tabs.tsx @@ -3,6 +3,9 @@ import { GlobalSimpleBarProvider } from "./hooks/global-simplebar"; import { Link, useLocation } from "react-router-dom"; import { ColorPalette } from "./styles"; import { useTheme } from "styled-components"; +import { YAxis } from "./components/axis"; +import { Caption2 } from "./components/typography"; +import { Box } from "./components/box"; export const BottomTabsHeightRem = "3.75rem"; @@ -12,6 +15,7 @@ export const BottomTabsRouteProvider: FunctionComponent<{ tabs: { pathname: string; icon: React.ReactNode; + text: string; }[]; forceHideBottomTabs?: boolean; @@ -67,26 +71,61 @@ export const BottomTabsRouteProvider: FunctionComponent<{ const isActive = tab.pathname === location.pathname; return ( - -
+ { - if (theme.mode === "light") { - return isActive - ? ColorPalette["blue-400"] - : ColorPalette["gray-100"]; - } - - return isActive - ? ColorPalette["gray-100"] - : ColorPalette["gray-400"]; - })(), + textDecoration: "none", }} > - {tab.icon} -
- +
{ + if (theme.mode === "light") { + return isActive + ? ColorPalette["blue-400"] + : ColorPalette["gray-100"]; + } + + return isActive + ? ColorPalette["gray-100"] + : ColorPalette["gray-400"]; + })(), + }} + > + + {tab.icon} + { + if (theme.mode === "light") { + return isActive + ? ColorPalette["blue-400"] + : ColorPalette["gray-200"]; + } + + return isActive + ? ColorPalette["gray-100"] + : ColorPalette["gray-300"]; + })()} + > + {tab.text} + + +
+ + ); })} diff --git a/packages/extension/src/index.tsx b/packages/extension/src/index.tsx index 4f1f2be98f..4796b64f70 100644 --- a/packages/extension/src/index.tsx +++ b/packages/extension/src/index.tsx @@ -86,6 +86,7 @@ import { } from "./bottom-tabs"; import { IBCSwapDestinationSelectAssetPage } from "./pages/ibc-swap/select-asset"; import { RoutePageAnalytics } from "./route-page-analytics"; +import { useIntl } from "react-intl"; configure({ enforceActions: "always", // Make mobx to strict mode. @@ -278,6 +279,8 @@ const RoutesAfterReady: FunctionComponent = observer(() => { const [mainPageIsNotReady, setMainPageIsNotReady] = useState(false); + const intl = useIntl(); + return ( { { pathname: "/", icon: , + text: intl.formatMessage({ + id: "bottom-tabs.home", + }), }, { pathname: "/ibc-swap", icon: , + text: intl.formatMessage({ + id: "bottom-tabs.swap", + }), }, { pathname: "/setting", icon: , + text: intl.formatMessage({ + id: "bottom-tabs.settings", + }), }, ]} > diff --git a/packages/extension/src/languages/en.json b/packages/extension/src/languages/en.json index e52ff26e5a..e460223058 100644 --- a/packages/extension/src/languages/en.json +++ b/packages/extension/src/languages/en.json @@ -23,6 +23,10 @@ "error.outdated-cosmos-sdk": "Not supported: outdated version of cosmos-sdk", "error.can-not-find-fee-for-claim-all": "Can't find fee currency to pay", + "bottom-tabs.home": "Home", + "bottom-tabs.swap": "Swap", + "bottom-tabs.settings": "Settings", + "pages.register.components.header.intro-title": "Your Interchain Gateway", "pages.register.components.header.header-step.title": "Step", "pages.register.components.help-desk-button.title": "Help Desk", diff --git a/packages/extension/src/languages/ko.json b/packages/extension/src/languages/ko.json index 7be45c4998..9ee606f070 100644 --- a/packages/extension/src/languages/ko.json +++ b/packages/extension/src/languages/ko.json @@ -23,6 +23,10 @@ "error.outdated-cosmos-sdk": "cosmos-sdk 버전이 오래돼서 지원되지 않습니다.", "error.can-not-find-fee-for-claim-all": "수수료로 지불할 통화를 찾을 수 없습니다.", + "bottom-tabs.home": "홈", + "bottom-tabs.swap": "스왑", + "bottom-tabs.settings": "설정", + "pages.register.components.header.intro-title": "내 손 안의 인터체인", "pages.register.components.header.header-step.title": "단계", "pages.register.components.help-desk-button.title": "도움말 및 지원",