import { ConnectProps, ConnectState } from '@/models/connect'; import { Icon, Tooltip } 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'; export type SiderTheme = 'light' | 'dark'; export interface GlobalHeaderRightProps extends ConnectProps { theme?: SiderTheme; layout: 'sidemenu' | 'topmenu'; } const GlobalHeaderRight: React.SFC = props => { const { theme, layout } = props; let className = styles.right; if (theme === 'dark' && layout === 'topmenu') { className = `${styles.right} ${styles.dark}`; } return (
{ console.log('input', value); }} onPressEnter={value => { console.log('enter', value); }} />
); }; export default connect(({ settings }: ConnectState) => ({ theme: settings.navTheme, layout: settings.layout, }))(GlobalHeaderRight);