Minor cleanup of profile page for clients and providers

This commit is contained in:
Alexander Wong 2017-09-04 00:37:06 -06:00
parent f0c30f1023
commit 4ee5670cfb

View File

@ -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) {
return (
<List.Item key={key}>
{key}: {user.userinfo[key]} {key}: {user.userinfo[key]}
</List.Item>) </List.Item>
);
})} })}
</List>} {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>