diff --git a/web/src/layouts/components/right-toolbar/index.less b/web/src/layouts/components/right-toolbar/index.less index 9f9b9ebc31..2749f19b4d 100644 --- a/web/src/layouts/components/right-toolbar/index.less +++ b/web/src/layouts/components/right-toolbar/index.less @@ -15,3 +15,7 @@ vertical-align: middle; cursor: pointer; } + +.language { + cursor: pointer; +} diff --git a/web/src/layouts/components/right-toolbar/index.tsx b/web/src/layouts/components/right-toolbar/index.tsx index d60ec463fa..68e99201f6 100644 --- a/web/src/layouts/components/right-toolbar/index.tsx +++ b/web/src/layouts/components/right-toolbar/index.tsx @@ -1,6 +1,5 @@ -import { ReactComponent as TranslationIcon } from '@/assets/svg/translation.svg'; import { useTranslate } from '@/hooks/commonHooks'; -import { GithubOutlined } from '@ant-design/icons'; +import { DownOutlined, GithubOutlined } from '@ant-design/icons'; import { Dropdown, MenuProps, Space } from 'antd'; import camelCase from 'lodash/camelCase'; import React from 'react'; @@ -8,6 +7,7 @@ import User from '../user'; import { LanguageList } from '@/constants/common'; import { useChangeLanguage } from '@/hooks/logicHooks'; +import { useSelector } from 'umi'; import styled from './index.less'; const Circle = ({ children, ...restProps }: React.PropsWithChildren) => { @@ -25,6 +25,7 @@ const handleGithubCLick = () => { const RightToolBar = () => { const { t } = useTranslate('common'); const changeLanguage = useChangeLanguage(); + const { language = '' } = useSelector((state) => state.settingModel.userInfo); const handleItemClick: MenuProps['onClick'] = ({ key }) => { changeLanguage(key); @@ -40,14 +41,15 @@ const RightToolBar = () => { return (