Minor cleanup of profile page for clients and providers

master
Alexander Wong 7 years ago
parent f0c30f1023
commit 4ee5670cfb
  1. 42
      src/components/User/Profile.jsx

@ -22,21 +22,43 @@ const ProfileView = ({ user }) => (
<Card.Meta>{user.email || "No email!"}</Card.Meta> <Card.Meta>{user.email || "No email!"}</Card.Meta>
<Card.Description> <Card.Description>
<span> <span>
{user.client && "Client"}{user.provider && "Provider"} {!user.client &&
{!user.client && !user.provider && "User Registration Not Completed"} !user.provider &&
"User Registration Not Completed"}
</span> </span>
{user.first_name} {user.last_name} {user.first_name} {user.last_name}
{user.userinfo && <List> <List>
{Object.keys(user.userinfo).map(function(key) { {user.userinfo &&
return (<List.Item key={key}> Object.keys(user.userinfo).map(function(key) {
{key}: {user.userinfo[key]} return (
</List.Item>) <List.Item key={key}>
})} {key}: {user.userinfo[key]}
</List>} </List.Item>
);
})}
{user.client &&
Object.keys(user.client).map(function(key) {
return (
<List.Item key={key}>
{key}: {user.client[key]}
</List.Item>
);
})}
{user.provider &&
Object.keys(user.provider).map(function(key) {
return (
<List.Item key={key}>
{key}: {user.provider[key]}
</List.Item>
);
})}
</List>
</Card.Description> </Card.Description>
</Card.Content> </Card.Content>
<Card.Content extra> <Card.Content extra>
<Label color={user.is_active ? "teal" : "red"} size="tiny" tag> {user.client && <Label color="blue">Client</Label>}
{user.provider && <Label color="orange">Provider</Label>}
<Label color={user.is_active ? "teal" : "red"}>
{user.is_active ? "Active" : "Deactivated"} {user.is_active ? "Active" : "Deactivated"}
</Label> </Label>
</Card.Content> </Card.Content>

Loading…
Cancel
Save