Make the transition based router be grouped more cleanly.

This commit is contained in:
Dane Everitt 2019-06-22 17:45:32 -07:00
parent d22747b0b1
commit f34593e777
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 65 additions and 79 deletions

View file

@ -1,18 +1,16 @@
import React, { useState } from 'react';
import { Link } from 'react-router-dom';
import { Link, RouteComponentProps } from 'react-router-dom';
import login from '@/api/auth/login';
import { httpErrorToHuman } from '@/api/http';
import LoginFormContainer from '@/components/auth/LoginFormContainer';
import FlashMessageRender from '@/components/FlashMessageRender';
import { Actions, useStoreActions } from 'easy-peasy';
import { ApplicationState } from '@/state/types';
import useRouter from 'use-react-router';
export default () => {
export default ({ history }: RouteComponentProps) => {
const [ username, setUsername ] = useState('');
const [ password, setPassword ] = useState('');
const [ isLoading, setLoading ] = useState(false);
const { history } = useRouter();
const { clearFlashes, addFlash } = useStoreActions((actions: Actions<ApplicationState>) => actions.flashes);