From d80739a203f846f9cea12f0a605612620dd018af Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Wed, 28 Aug 2024 09:35:16 +0900 Subject: [PATCH 1/3] Remove `locale.css` --- src/app/layout.tsx | 1 - src/styles/locale.css | 29 ----------------------------- 2 files changed, 30 deletions(-) delete mode 100644 src/styles/locale.css diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 92285c63dd..999cea0321 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -4,7 +4,6 @@ import '@fontsource/inter/400.css'; import '@fontsource/inter/700.css'; import '@fontsource/inter/800.css'; import 'react-basics/dist/styles.css'; -import 'styles/locale.css'; import 'styles/index.css'; import 'styles/variables.css'; diff --git a/src/styles/locale.css b/src/styles/locale.css deleted file mode 100644 index dddf495b6a..0000000000 --- a/src/styles/locale.css +++ /dev/null @@ -1,29 +0,0 @@ -.zh-CN { - font-family: '方体', 'PingFang SC', '黑体', 'Heiti SC', 'Microsoft JhengHei UI', - 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK SC', sans-serif !important; -} - -.zh-TW { - font-family: '方體', 'PingFang TC', '黑體', 'Heiti TC', 'Microsoft JhengHei UI', - 'Microsoft JhengHei', Roboto, Noto, 'Noto Sans CJK TC', sans-serif !important; -} - -.ja-JP { - font-family: '游ゴシック体', YuGothic, 'ヒラギノ丸ゴ', 'Hiragino Sans', 'Yu Gothic UI', - 'Meiryo UI', 'MS Gothic', Roboto, Noto, 'Noto Sans CJK JP', sans-serif !important; -} - -.ko-KR { - font-family: 'Nanum Gothic', 'Apple SD Gothic Neo', 'Malgun Gothic', Roboto, Noto, - 'Noto Sans CJK KR', sans-serif !important; -} - -.ar-SA { - font-family: 'Geeza Pro', 'Arabic Typesetting', Roboto, Noto, 'Noto Naskh Arabic', - 'Times New Roman', serif !important; -} - -.he-IL { - font-family: 'New Peninim MT', 'Arial Hebrew', Gisha, 'Times New Roman', Roboto, Noto, - 'Noto Sans Hebrew', sans-serif !important; -} From d7734d0493bbb0451270695d8939fd6e548b6c32 Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Wed, 28 Aug 2024 10:13:11 +0900 Subject: [PATCH 2/3] Remove className locale --- src/components/input/LanguageButton.tsx | 4 ++-- src/components/metrics/CountriesTable.tsx | 7 +------ src/components/metrics/LanguagesTable.tsx | 2 +- src/components/metrics/Legend.tsx | 5 +---- src/components/metrics/RegionsTable.tsx | 2 +- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/components/input/LanguageButton.tsx b/src/components/input/LanguageButton.tsx index fcaa4046ee..5da3bf7845 100644 --- a/src/components/input/LanguageButton.tsx +++ b/src/components/input/LanguageButton.tsx @@ -1,4 +1,4 @@ -import { Icon, Button, PopupTrigger, Popup, Text } from 'react-basics'; +import { Icon, Button, PopupTrigger, Popup } from 'react-basics'; import classNames from 'classnames'; import { languages } from 'lib/lang'; import { useLocale } from 'components/hooks'; @@ -33,7 +33,7 @@ export function LanguageButton() { className={classNames(styles.item, { [styles.selected]: value === locale })} onClick={(e: any) => handleSelect(value, close, e)} > - {label} + {label} {value === locale && ( diff --git a/src/components/metrics/CountriesTable.tsx b/src/components/metrics/CountriesTable.tsx index 592ade8a0d..c1fc28318c 100644 --- a/src/components/metrics/CountriesTable.tsx +++ b/src/components/metrics/CountriesTable.tsx @@ -12,12 +12,7 @@ export function CountriesTable({ ...props }: MetricsTableProps) { const renderLink = ({ x: code }) => { return ( - + ); diff --git a/src/components/metrics/LanguagesTable.tsx b/src/components/metrics/LanguagesTable.tsx index 67b6e62237..f4b0b50386 100644 --- a/src/components/metrics/LanguagesTable.tsx +++ b/src/components/metrics/LanguagesTable.tsx @@ -13,7 +13,7 @@ export function LanguagesTable({ const languageNames = useLanguageNames(locale); const renderLabel = ({ x }) => { - return
{languageNames[x?.split('-')[0]] ?? x}
; + return languageNames[x?.split('-')[0]] ?? x; }; return ( diff --git a/src/components/metrics/Legend.tsx b/src/components/metrics/Legend.tsx index c7ef1022b0..4ebcf4b440 100644 --- a/src/components/metrics/Legend.tsx +++ b/src/components/metrics/Legend.tsx @@ -3,7 +3,6 @@ import { safeDecodeURIComponent } from 'next-basics'; import { colord } from 'colord'; import classNames from 'classnames'; import { LegendItem } from 'chart.js/auto'; -import { useLocale } from 'components/hooks'; import styles from './Legend.module.css'; export function Legend({ @@ -13,8 +12,6 @@ export function Legend({ items: any[]; onClick: (index: LegendItem) => void; }) { - const { locale } = useLocale(); - if (!items.find(({ text }) => text)) { return null; } @@ -32,7 +29,7 @@ export function Legend({ onClick={() => onClick(item)} > - {safeDecodeURIComponent(text)} + {safeDecodeURIComponent(text)} ); diff --git a/src/components/metrics/RegionsTable.tsx b/src/components/metrics/RegionsTable.tsx index 215551af8b..b4071f50ec 100644 --- a/src/components/metrics/RegionsTable.tsx +++ b/src/components/metrics/RegionsTable.tsx @@ -11,7 +11,7 @@ export function RegionsTable(props: MetricsTableProps) { const renderLink = ({ x: code, country }) => { return ( - + ); From bd728682d24d7fb4a8f7968bd7c944b68b127bc6 Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Wed, 28 Aug 2024 16:31:42 +0900 Subject: [PATCH 3/3] Update RealtimeCountries.tsx --- .../(main)/websites/[websiteId]/realtime/RealtimeCountries.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/(main)/websites/[websiteId]/realtime/RealtimeCountries.tsx b/src/app/(main)/websites/[websiteId]/realtime/RealtimeCountries.tsx index ae4967dab9..5166344101 100644 --- a/src/app/(main)/websites/[websiteId]/realtime/RealtimeCountries.tsx +++ b/src/app/(main)/websites/[websiteId]/realtime/RealtimeCountries.tsx @@ -12,7 +12,7 @@ export function RealtimeCountries({ data }) { const renderCountryName = useCallback( ({ x: code }) => ( - + {countryNames[code]}