Skip to content

Commit

Permalink
use constants for user role colors
Browse files Browse the repository at this point in the history
  • Loading branch information
arrested-developer committed Oct 5, 2019
1 parent 79c186a commit 858181f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/Admin/Users/UserListItem.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import React from 'react';
import { List, Icon } from 'antd';
import { List, Icon, Tag } from 'antd';
import { RoleTile, UserTitle } from './Users.style';
import { renderUserDetails } from '../../../constants/users';
import { userRoleColor } from '../../../constants/colors';

const Title = ({ name, status, role }) => {
return (
<UserTitle>
<div style={{ marginRight: '0.4rem' }}>{name}</div>
<div>
<RoleTile>{renderUserDetails[role]}</RoleTile>
<Tag color={userRoleColor[role]}>{renderUserDetails[role]}</Tag>
{status !== 'unverified' ? (
<Icon type="check" style={{ marginLeft: '0.5rem', color: 'green' }} />
) : (
Expand Down
6 changes: 6 additions & 0 deletions src/constants/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ export const useClassColor = {
D2: appColors.ORANGE,
Other: appColors.WHITE,
};

export const userRoleColor = {
user: appColors.GREEN,
superUser: appColors.PINK,
admin: appColors.GOLD,
};

0 comments on commit 858181f

Please sign in to comment.