mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-06 01:15:42 +01:00
Merge pull request #2919 from quiple/fix-font-family
Remove `className={locale}` and add `lang` attribute to `LanguageButton()`
This commit is contained in:
commit
2ed22f8975
@ -12,7 +12,7 @@ export function RealtimeCountries({ data }) {
|
|||||||
|
|
||||||
const renderCountryName = useCallback(
|
const renderCountryName = useCallback(
|
||||||
({ x: code }) => (
|
({ x: code }) => (
|
||||||
<span className={classNames(locale, styles.row)}>
|
<span className={classNames(styles.row)}>
|
||||||
<TypeIcon type="country" value={code?.toLowerCase()} />
|
<TypeIcon type="country" value={code?.toLowerCase()} />
|
||||||
{countryNames[code]}
|
{countryNames[code]}
|
||||||
</span>
|
</span>
|
||||||
|
@ -4,7 +4,6 @@ import '@fontsource/inter/400.css';
|
|||||||
import '@fontsource/inter/700.css';
|
import '@fontsource/inter/700.css';
|
||||||
import '@fontsource/inter/800.css';
|
import '@fontsource/inter/800.css';
|
||||||
import 'react-basics/dist/styles.css';
|
import 'react-basics/dist/styles.css';
|
||||||
import 'styles/locale.css';
|
|
||||||
import 'styles/index.css';
|
import 'styles/index.css';
|
||||||
import 'styles/variables.css';
|
import 'styles/variables.css';
|
||||||
|
|
||||||
|
@ -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 classNames from 'classnames';
|
||||||
import { languages } from 'lib/lang';
|
import { languages } from 'lib/lang';
|
||||||
import { useLocale } from 'components/hooks';
|
import { useLocale } from 'components/hooks';
|
||||||
@ -33,7 +33,7 @@ export function LanguageButton() {
|
|||||||
className={classNames(styles.item, { [styles.selected]: value === locale })}
|
className={classNames(styles.item, { [styles.selected]: value === locale })}
|
||||||
onClick={(e: any) => handleSelect(value, close, e)}
|
onClick={(e: any) => handleSelect(value, close, e)}
|
||||||
>
|
>
|
||||||
<Text>{label}</Text>
|
<span lang={value}>{label}</span>
|
||||||
{value === locale && (
|
{value === locale && (
|
||||||
<Icon className={styles.icon}>
|
<Icon className={styles.icon}>
|
||||||
<Icons.Check />
|
<Icons.Check />
|
||||||
|
@ -12,12 +12,7 @@ export function CountriesTable({ ...props }: MetricsTableProps) {
|
|||||||
|
|
||||||
const renderLink = ({ x: code }) => {
|
const renderLink = ({ x: code }) => {
|
||||||
return (
|
return (
|
||||||
<FilterLink
|
<FilterLink id="country" value={countryNames[code] && code} label={formatCountry(code)}>
|
||||||
id="country"
|
|
||||||
className={locale}
|
|
||||||
value={countryNames[code] && code}
|
|
||||||
label={formatCountry(code)}
|
|
||||||
>
|
|
||||||
<TypeIcon type="country" value={code?.toLowerCase()} />
|
<TypeIcon type="country" value={code?.toLowerCase()} />
|
||||||
</FilterLink>
|
</FilterLink>
|
||||||
);
|
);
|
||||||
|
@ -13,7 +13,7 @@ export function LanguagesTable({
|
|||||||
const languageNames = useLanguageNames(locale);
|
const languageNames = useLanguageNames(locale);
|
||||||
|
|
||||||
const renderLabel = ({ x }) => {
|
const renderLabel = ({ x }) => {
|
||||||
return <div className={locale}>{languageNames[x?.split('-')[0]] ?? x}</div>;
|
return languageNames[x?.split('-')[0]] ?? x;
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -3,7 +3,6 @@ import { safeDecodeURIComponent } from 'next-basics';
|
|||||||
import { colord } from 'colord';
|
import { colord } from 'colord';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { LegendItem } from 'chart.js/auto';
|
import { LegendItem } from 'chart.js/auto';
|
||||||
import { useLocale } from 'components/hooks';
|
|
||||||
import styles from './Legend.module.css';
|
import styles from './Legend.module.css';
|
||||||
|
|
||||||
export function Legend({
|
export function Legend({
|
||||||
@ -13,8 +12,6 @@ export function Legend({
|
|||||||
items: any[];
|
items: any[];
|
||||||
onClick: (index: LegendItem) => void;
|
onClick: (index: LegendItem) => void;
|
||||||
}) {
|
}) {
|
||||||
const { locale } = useLocale();
|
|
||||||
|
|
||||||
if (!items.find(({ text }) => text)) {
|
if (!items.find(({ text }) => text)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -32,7 +29,7 @@ export function Legend({
|
|||||||
onClick={() => onClick(item)}
|
onClick={() => onClick(item)}
|
||||||
>
|
>
|
||||||
<StatusLight color={color.alpha(color.alpha() + 0.2).toHex()}>
|
<StatusLight color={color.alpha(color.alpha() + 0.2).toHex()}>
|
||||||
<span className={locale}>{safeDecodeURIComponent(text)}</span>
|
{safeDecodeURIComponent(text)}
|
||||||
</StatusLight>
|
</StatusLight>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -11,7 +11,7 @@ export function RegionsTable(props: MetricsTableProps) {
|
|||||||
|
|
||||||
const renderLink = ({ x: code, country }) => {
|
const renderLink = ({ x: code, country }) => {
|
||||||
return (
|
return (
|
||||||
<FilterLink id="region" className={locale} value={code} label={getRegionName(code, country)}>
|
<FilterLink id="region" value={code} label={getRegionName(code, country)}>
|
||||||
<TypeIcon type="country" value={country?.toLowerCase()} />
|
<TypeIcon type="country" value={country?.toLowerCase()} />
|
||||||
</FilterLink>
|
</FilterLink>
|
||||||
);
|
);
|
||||||
|
@ -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;
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user