BindingView.js 1.84 KB
Newer Older
1
import React, { Component, Fragment } from 'react';
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
2
import { formatMessage, FormattedMessage } from 'umi/locale';
3 4
import { Icon, List } from 'antd';

5
class BindingView extends Component {
6 7 8
  getData = () => {
    return [
      {
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
9 10
        title: formatMessage({ id: 'app.settings.binding.taobao' }, {}),
        description: formatMessage({ id: 'app.settings.binding.taobao-description' }, {}),
11 12 13 14 15
        actions: [
          <a>
            <FormattedMessage id="app.settings.binding.bind" defaultMessage="Bind" />
          </a>,
        ],
16 17 18
        avatar: <Icon type="taobao" className="taobao" />,
      },
      {
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
19 20
        title: formatMessage({ id: 'app.settings.binding.alipay' }, {}),
        description: formatMessage({ id: 'app.settings.binding.alipay-description' }, {}),
21 22 23 24 25
        actions: [
          <a>
            <FormattedMessage id="app.settings.binding.bind" defaultMessage="Bind" />
          </a>,
        ],
26 27 28
        avatar: <Icon type="alipay" className="alipay" />,
      },
      {
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
29 30
        title: formatMessage({ id: 'app.settings.binding.dingding' }, {}),
        description: formatMessage({ id: 'app.settings.binding.dingding-description' }, {}),
31 32 33 34 35
        actions: [
          <a>
            <FormattedMessage id="app.settings.binding.bind" defaultMessage="Bind" />
          </a>,
        ],
36 37 38 39
        avatar: <Icon type="dingding" className="dingding" />,
      },
    ];
  };
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
40

41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
  render() {
    return (
      <Fragment>
        <List
          itemLayout="horizontal"
          dataSource={this.getData()}
          renderItem={item => (
            <List.Item actions={item.actions}>
              <List.Item.Meta
                avatar={item.avatar}
                title={item.title}
                description={item.description}
              />
            </List.Item>
          )}
        />
      </Fragment>
    );
  }
}
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
61
export default BindingView;