2020-02-27 10:53:30 +08:00
|
|
|
import * as React from 'react';
|
|
|
|
import { Dropdown, Menu, Button } from 'antd';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
import { DownOutlined } from '@ant-design/icons';
|
|
|
|
import { SharedProps } from './interface';
|
|
|
|
|
2021-04-11 00:10:36 +08:00
|
|
|
const smallStyle = { fontSize: 12, color: '#777', marginLeft: '0.3em' };
|
|
|
|
|
2021-07-12 13:37:43 +08:00
|
|
|
export function getEcosystemGroup(): React.ReactNode {
|
2021-03-06 20:21:51 +08:00
|
|
|
return [
|
|
|
|
<Menu.Item key="charts">
|
|
|
|
<a
|
|
|
|
href="https://charts.ant.design"
|
|
|
|
className="header-link"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
|
|
|
<FormattedMessage id="app.header.menu.charts" />
|
|
|
|
</a>
|
|
|
|
</Menu.Item>,
|
|
|
|
<Menu.Item key="pro">
|
|
|
|
<a
|
|
|
|
href="http://pro.ant.design"
|
|
|
|
className="header-link"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
|
|
|
<FormattedMessage id="app.header.menu.pro.v4" />
|
|
|
|
</a>
|
|
|
|
</Menu.Item>,
|
2021-05-08 11:27:55 +08:00
|
|
|
<Menu.Item key="procomponents">
|
2021-07-12 13:32:44 +08:00
|
|
|
<a
|
|
|
|
href="http://procomponents.ant.design"
|
|
|
|
className="header-link"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
|
|
|
<FormattedMessage id="app.header.menu.pro.components" />
|
|
|
|
</a>
|
|
|
|
</Menu.Item>,
|
2021-03-06 20:21:51 +08:00
|
|
|
<Menu.Item key="ng">
|
|
|
|
<a
|
|
|
|
href="http://ng.ant.design"
|
|
|
|
className="header-link"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
|
|
|
Ant Design of Angular
|
2021-04-11 00:10:36 +08:00
|
|
|
<span style={smallStyle}>
|
|
|
|
(<FormattedMessage id="app.implementation.community" />)
|
|
|
|
</span>
|
2021-03-06 20:21:51 +08:00
|
|
|
</a>
|
|
|
|
</Menu.Item>,
|
|
|
|
<Menu.Item key="vue">
|
2021-07-12 13:32:44 +08:00
|
|
|
<a href="http://antdv.com" className="header-link" target="_blank" rel="noopener noreferrer">
|
2021-03-06 20:21:51 +08:00
|
|
|
Ant Design of Vue
|
2021-04-11 00:10:36 +08:00
|
|
|
<span style={smallStyle}>
|
|
|
|
(<FormattedMessage id="app.implementation.community" />)
|
|
|
|
</span>
|
2021-03-06 20:21:51 +08:00
|
|
|
</a>
|
|
|
|
</Menu.Item>,
|
|
|
|
];
|
2020-02-27 10:53:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default (props: SharedProps) => {
|
|
|
|
const menu = <Menu>{getEcosystemGroup(props)}</Menu>;
|
2020-04-26 17:53:08 +08:00
|
|
|
const downstyle = props.isRTL ? '-1px 2px 0 0' : '-1px 0 0 2px';
|
2020-02-27 10:53:30 +08:00
|
|
|
return (
|
|
|
|
<Dropdown overlay={menu} placement="bottomRight">
|
|
|
|
<Button size="small" className="header-button">
|
|
|
|
<FormattedMessage id="app.header.menu.more" />
|
2020-02-27 18:41:20 +08:00
|
|
|
<DownOutlined
|
|
|
|
style={{
|
|
|
|
fontSize: '9px',
|
2020-04-26 17:53:08 +08:00
|
|
|
margin: downstyle,
|
2020-02-27 18:41:20 +08:00
|
|
|
verticalAlign: 'middle',
|
|
|
|
}}
|
|
|
|
/>
|
2020-02-27 10:53:30 +08:00
|
|
|
</Button>
|
|
|
|
</Dropdown>
|
|
|
|
);
|
|
|
|
};
|