Skip to content

Commit

Permalink
fix table rows
Browse files Browse the repository at this point in the history
  • Loading branch information
felipe-rod123 committed Sep 27, 2023
1 parent f49a37d commit 270a38e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
42 changes: 24 additions & 18 deletions apps/meteor/client/views/admin/users/UsersTable/UsersTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,32 @@ const UsersTable = ({ reload, tab, onReload }: UsersTableProps): ReactElement |

const headers = useMemo(
() => [
<GenericTableHeaderCell key='name' direction={sortDirection} active={sortBy === 'name'} onClick={setSort} sort='name'>
{t('Name')}
</GenericTableHeaderCell>,
mediaQuery && (
<GenericTableHeaderCell key='name' direction={sortDirection} active={sortBy === 'name'} onClick={setSort} sort='name'>
{t('Name')}
</GenericTableHeaderCell>
),

<GenericTableHeaderCell key='username' direction={sortDirection} active={sortBy === 'username'} onClick={setSort} sort='username'>
{t('Username')}
</GenericTableHeaderCell>,
<GenericTableHeaderCell
key='email'
direction={sortDirection}
active={sortBy === 'emails.address'}
onClick={setSort}
sort='emails.address'
>
{t('Email')}
</GenericTableHeaderCell>,
mediaQuery && (
<GenericTableHeaderCell
key='email'
direction={sortDirection}
active={sortBy === 'emails.address'}
onClick={setSort}
sort='emails.address'
>
{t('Email')}
</GenericTableHeaderCell>
),

<GenericTableHeaderCell key='roles' onClick={setSort}>
{t('Roles')}
</GenericTableHeaderCell>,
mediaQuery && (
<GenericTableHeaderCell key='roles' onClick={setSort}>
{t('Roles')}
</GenericTableHeaderCell>
),
tab === 'all' && (
<GenericTableHeaderCell
w='x200'
Expand All @@ -126,14 +132,14 @@ const UsersTable = ({ reload, tab, onReload }: UsersTableProps): ReactElement |
),

tab === 'pending' && (
<GenericTableHeaderCell key='action' direction={sortDirection} active={sortBy === 'name'} onClick={setSort} sort='name'>
<GenericTableHeaderCell key='action' direction={sortDirection} active={sortBy === 'name'} onClick={setSort} sort='name' w='x320'>
{t('Pending_action')}
</GenericTableHeaderCell>
),

<GenericTableHeaderCell key='menu' />,
<GenericTableHeaderCell key='menu' w='x40' justifyItems='center' />,
],
[setSort, sortBy, sortDirection, t, tab],
[mediaQuery, setSort, sortBy, sortDirection, t, tab],
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,23 +88,24 @@ const UsersTableRow = ({ user, onClick, mediaQuery, refetchUsers, onReload, tab
onClick={(e): void => {
e.stopPropagation();
}}
w='fit-content'
>
<Box display='flex' flexDirection='row' alignContent='flex-end'>
{active ? t('User_first_log_in') : t('Activation')}
{active ? (
<Button small secondary>
<Button small secondary mi='x32'>
{t('Resend_welcome_email')}
</Button>
) : (
<Button small primary>
<Button small primary mi='x32'>
{t('Activate')}
</Button>
)}
</Box>
</GenericTableCell>
)}

<GenericTableCell alignContent='flex-start' w='x8'>
<GenericTableCell justifyContent='center'>
<ActionsMenu user={user} refetchUsers={refetchUsers} onReload={onReload} tab={tab} />
</GenericTableCell>
</GenericTableRow>
Expand Down

0 comments on commit 270a38e

Please sign in to comment.