Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed admin card navigation in dashboard #1168

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 5 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 Down Expand Up @@ -28,9 +29,12 @@ function organizationPeople(): JSX.Element {

document.title = t('title');

const location = useLocation();
const role = location?.state as any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont use any here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
removed the use of any defined interface instead


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