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 all commits
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
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
Loading