Set the current page in the dashboard URL to allow easy refreshing; closes #2993

This commit is contained in:
Dane Everitt 2021-03-21 12:07:24 -07:00
parent 7676f7dd66
commit 29b4b52397
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 35 additions and 7 deletions

View file

@ -7,8 +7,8 @@ import PageContentBlock from '@/components/elements/PageContentBlock';
import tw from 'twin.macro';
import { breakpoint } from '@/theme';
import styled from 'styled-components/macro';
import { RouteComponentProps } from 'react-router';
import MessageBox from '@/components/MessageBox';
import { useLocation } from 'react-router-dom';
const Container = styled.div`
${tw`flex flex-wrap`};
@ -26,7 +26,9 @@ const Container = styled.div`
}
`;
export default ({ location: { state } }: RouteComponentProps) => {
export default () => {
const { state } = useLocation<undefined | { twoFactorRedirect?: boolean }>();
return (
<PageContentBlock title={'Account Overview'}>
{state?.twoFactorRedirect &&