summaryrefslogtreecommitdiffstats
path: root/front/odiparpack/app/components/CardPaper/IdentityCard.js
blob: 4f4bd6c9ea82ed7c3bbad14b9bc7e1ebba9c94aa (plain)
1
2
3
4
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import LocalPhone from '@material-ui/icons/LocalPhone';
import LocationOn from '@material-ui/icons/LocationOn';
import {
  Card, Typography, CardContent,
  ListItem, ListItemText, ListItemAvatar,
  Avatar, Divider
} from '@material-ui/core';
import styles from './cardStyle-jss';


class IdentityCard extends React.Component {
  render() {
    const {
      classes,
      title,
      name,
      avatar,
      phone,
      address,
    } = this.props;
    return (
      <Card className={classes.card}>
        <CardContent>
          <Typography variant="subtitle1">{title}</Typography>
          <Divider className={classes.divider} />
          <ListItem>
            <ListItemAvatar>
              <Avatar
                alt={name}
                src={avatar}
                className={classes.avatar}
              />
            </ListItemAvatar>
            <ListItemText primary="Name" secondary={name} />
          </ListItem>
          <ListItem>
            <ListItemAvatar>
              <Avatar>
                <LocalPhone />
              </Avatar>
            </ListItemAvatar>
            <ListItemText primary="Phone" secondary={phone} />
          </ListItem>
          <ListItem>
            <ListItemAvatar>
              <Avatar>
                <LocationOn />
              </Avatar>
            </ListItemAvatar>
            <ListItemText primary="Address" secondary={address} />
          </ListItem>
        </CardContent>
      </Card>
    );
  }
}

IdentityCard.propTypes = {
  classes: PropTypes.object.isRequired,
  title: PropTypes.string.isRequired,
  name: PropTypes.string.isRequired,
  avatar: PropTypes.string.isRequired,
  phone: PropTypes.string.isRequired,
  address: PropTypes.string.isRequired,
};

export default withStyles(styles)(IdentityCard);