MessageView.js 1.1 KB
Newer Older
陈帅's avatar
陈帅 committed
1 2 3
import React, { Component, Fragment } from 'react';
import { Switch, List } from 'antd';

jim's avatar
jim committed
4
const Action = <Switch checkedChildren="" unCheckedChildren="" defaultChecked />;
陈帅's avatar
陈帅 committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

export default class MessageView extends Component {
  getData = () => {
    return [
      {
        title: '账户密码',
        description: '其他用户的消息将以站内信的形式通知',
        actions: [Action],
      },
      {
        title: '系统消息',
        description: '系统消息将以站内信的形式通知',
        actions: [Action],
      },
      {
        title: '待办通知',
        description: '待办事项将以站内信的形式通知',
        actions: [Action],
      },
    ];
  };
  render() {
    return (
      <Fragment>
        <List
          itemLayout="horizontal"
          dataSource={this.getData()}
          renderItem={item => (
            <List.Item actions={item.actions}>
              <List.Item.Meta
                title={item.title}
                description={item.description}
              />
            </List.Item>
          )}
        />
      </Fragment>
    );
  }
}