forked from react-materialize/react-materialize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserView.js
43 lines (39 loc) · 990 Bytes
/
UserView.js
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
import React, { Component } from 'react';
import PropTypes from 'prop-types';
export const UserShape = {
background: PropTypes.string,
image: PropTypes.string,
name: PropTypes.string,
email: PropTypes.string
};
export class UserView extends Component {
render() {
const { background, image, name, email } = this.props;
return (
<div className="userView">
{background && (
<div className="background">
<img src={background} />
</div>
)}
{image && (
<a href="#!user">
<img className="circle" src={image} />
</a>
)}
{name && (
<a href="#!name">
<span className="white-text name">{name}</span>
</a>
)}
{email && (
<a href="#!email">
<span className="white-text email">{email}</span>
</a>
)}
</div>
);
}
}
UserView.propTypes = UserShape;
export default UserView;