Skip to content

Commit d1a458e

Browse files
committed
fix: restore user navigation button on user list page
1 parent b8c5044 commit d1a458e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/ui/views/UserList/Components/UserList.jsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
22
import { makeStyles } from '@material-ui/core/styles';
33
import GridItem from '../../../components/Grid/GridItem';
44
import GridContainer from '../../../components/Grid/GridContainer';
5+
import { useNavigate } from 'react-router-dom';
56
import Button from '@material-ui/core/Button';
67
import Table from '@material-ui/core/Table';
78
import TableBody from '@material-ui/core/TableBody';
@@ -25,10 +26,13 @@ export default function UserList(props) {
2526
const [, setAuth] = useState(true);
2627
const [isLoading, setIsLoading] = useState(false);
2728
const [isError, setIsError] = useState(false);
29+
const navigate = useNavigate();
2830
const [currentPage, setCurrentPage] = useState(1);
2931
const itemsPerPage = 5;
3032
const [searchQuery, setSearchQuery] = useState('');
3133

34+
const openUser = (username) => navigate(`/admin/user/${username}`, { replace: true });
35+
3236

3337
useEffect(() => {
3438
const query = {};
@@ -98,7 +102,11 @@ export default function UserList(props) {
98102
{row.admin ? <Check fontSize='small' color='primary' /> : <CloseRounded color='error' />}
99103
</TableCell>
100104
<TableCell component='th' scope='row'>
101-
<Button variant='contained' color='primary'>
105+
<Button
106+
variant='contained'
107+
color='primary'
108+
onClick={() => openUser(row.username)}
109+
>
102110
<KeyboardArrowRight />
103111
</Button>
104112
</TableCell>

0 commit comments

Comments
 (0)