import { ConnectProps, ConnectState } from '@/models/connect'; import { Icon, Tooltip, message } from 'antd'; import Avatar from './AvatarDropdown'; import HeaderSearch from '../HeaderSearch'; import React from 'react'; import SelectLang from '../SelectLang'; import { connect } from 'dva'; import { formatMessage } from 'umi-plugin-react/locale'; import styles from './index.less'; import NoticeIconView from './NoticeIconView'; import DefaultSettings from 'config/defaultSettings'; export type SiderTheme = 'light' | 'dark'; export interface GlobalHeaderRightProps extends ConnectProps { theme?: SiderTheme; layout: 'sidemenu' | 'topmenu'; } const goHelpPage = (e: React.MouseEvent) => { e.preventDefault(); message.info('go go go! help page.'); }; const GlobalHeaderRight: React.SFC = props => { const { theme, layout } = props; let className = styles.right; if (theme === 'dark' && layout === 'topmenu') { className = `${styles.right} ${styles.dark}`; } return (
); }; export default connect(({ settings }: ConnectState) => ({ theme: settings.navTheme, layout: settings.layout, }))(GlobalHeaderRight);