caremyway-client/src/components/User/Client/ClientProfile.jsx

28 lines
701 B
React
Raw Normal View History

2017-09-21 21:01:49 +00:00
import React, { Component } from "react";
import { connect } from "react-redux";
import { Card } from "semantic-ui-react";
2017-09-21 21:01:49 +00:00
class ClientProfile extends Component {
render() {
const { selfUser } = this.props;
return <ClientProfileView user={selfUser} />;
2017-09-21 21:01:49 +00:00
}
}
function mapStateToProps(state) {
return { ...state.user };
}
const ClientProfileView = ({ user }) => (
<Card fluid={true}>
<Card.Content>
<Card.Header>Client Information</Card.Header>
{user.client &&
user.client.business_number &&
<Card.Meta>Business Number: {user.client.business_number}</Card.Meta>}
</Card.Content>
</Card>
2017-09-21 21:01:49 +00:00
);
export default connect(mapStateToProps)(ClientProfile);