Skip to content

Commit

Permalink
Fixed admin card navigation in dashboard (#1168)
Browse files Browse the repository at this point in the history
* fixed admin card navigation in dashboard

* removed the use of any
  • Loading branch information
chandel-aman authored Dec 9, 2023
1 parent 044b336 commit dc1f033
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function organizationDashboard(): JSX.Element {
role="button"
className="mb-4"
onClick={(): void => {
history.push(peopleLink);
history.push(peopleLink, { role: 1 });
}}
>
<DashBoardCard
Expand Down
10 changes: 9 additions & 1 deletion src/screens/OrganizationPeople/OrganizationPeople.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useLazyQuery } from '@apollo/client';
import dayjs from 'dayjs';
import React, { useEffect, useState } from 'react';
import { useLocation } from 'react-router-dom';
import { Container, Form } from 'react-bootstrap';
import Col from 'react-bootstrap/Col';
import Row from 'react-bootstrap/Row';
Expand All @@ -21,16 +22,23 @@ import styles from './OrganizationPeople.module.css';

import { toast } from 'react-toastify';

interface InterfaceLocationState {
role: number;
}

function organizationPeople(): JSX.Element {
const { t } = useTranslation('translation', {
keyPrefix: 'organizationPeople',
});

document.title = t('title');

const location = useLocation<InterfaceLocationState>();
const role = location?.state;

const currentUrl = window.location.href.split('=')[1];

const [state, setState] = useState(0);
const [state, setState] = useState(role?.role || 0);
const [page, setPage] = useState(0);
const [rowsPerPage, setRowsPerPage] = useState(5);

Expand Down

0 comments on commit dc1f033

Please sign in to comment.