From af597c7a291c37b3739940a5afbb235b824fe3a0 Mon Sep 17 00:00:00 2001 From: dengfuping Date: Tue, 31 Oct 2023 20:33:00 +0800 Subject: [PATCH] fix(ui): BasicLayout locale switch style font size is too large --- packages/ui/src/BasicLayout/Header.tsx | 12 ++++++------ packages/ui/src/BasicLayout/style/Header.ts | 2 +- packages/ui/src/LocaleDropdown/index.tsx | 13 ++++++++----- packages/ui/src/Login/index.tsx | 6 +----- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/packages/ui/src/BasicLayout/Header.tsx b/packages/ui/src/BasicLayout/Header.tsx index 5b7ef7c5d..471b6ea92 100644 --- a/packages/ui/src/BasicLayout/Header.tsx +++ b/packages/ui/src/BasicLayout/Header.tsx @@ -170,9 +170,7 @@ const Header: React.FC = ({ )} {showLocale && ( - - - + )} {userMenu ? ( @@ -223,9 +221,11 @@ const Header: React.FC = ({ )} {showLocale && ( - - - + )} {userMenu ? ( diff --git a/packages/ui/src/BasicLayout/style/Header.ts b/packages/ui/src/BasicLayout/style/Header.ts index 5aee9c631..46707c59a 100644 --- a/packages/ui/src/BasicLayout/style/Header.ts +++ b/packages/ui/src/BasicLayout/style/Header.ts @@ -5,7 +5,7 @@ import { genComponentStyleHook } from '../../_util/genComponentStyleHook'; export type HeaderToken = FullToken; export const genHeaderStyle: GenerateStyle = (token: HeaderToken): CSSObject => { - const { antCls, componentCls } = token; + const { componentCls } = token; return { [`${componentCls}`]: { diff --git a/packages/ui/src/LocaleDropdown/index.tsx b/packages/ui/src/LocaleDropdown/index.tsx index 8e4f2f54f..5605683e1 100644 --- a/packages/ui/src/LocaleDropdown/index.tsx +++ b/packages/ui/src/LocaleDropdown/index.tsx @@ -5,7 +5,7 @@ import type { DropdownProps } from '@oceanbase/design/es/dropdown'; import React from 'react'; import { LOCALE_LIST } from '../constant'; import type { Locale } from '../interface'; -import { getLocale, getPrefix, setLocale } from '../_util'; +import { getLocale, setLocale } from '../_util'; export interface LocaleDropdownProps extends DropdownProps { // 自定义语言列表 @@ -13,9 +13,12 @@ export interface LocaleDropdownProps extends DropdownProps { showLabel?: boolean; } -const prefix = getPrefix('layout-header'); - -const LocaleDropdown: React.FC = ({ locales, showLabel, ...restProps }) => { +const LocaleDropdown: React.FC = ({ + locales, + showLabel, + className, + ...restProps +}) => { // 语言切换菜单 const localeMenu = ( = ({ locales, showLabel, ... {findByValue(LOCALE_LIST, getLocale()).minLabel} ) : ( - + {findByValue(LOCALE_LIST, getLocale()).shortLabel} diff --git a/packages/ui/src/Login/index.tsx b/packages/ui/src/Login/index.tsx index 99084c75d..135a2b7b3 100644 --- a/packages/ui/src/Login/index.tsx +++ b/packages/ui/src/Login/index.tsx @@ -166,11 +166,7 @@ const Login: React.FC = props => {
- {showLocale && ( - - - - )} + {showLocale && } {board &&
{board}
}
{showActivate ? (