Centralize all redux types into one place, add overrides for the connect, useSelector and useDispatch functions

This commit is contained in:
ErickSkrauch
2020-07-22 13:01:12 +03:00
parent 96e74cf9bb
commit 5a9c54002d
44 changed files with 199 additions and 141 deletions

View File

@@ -1,10 +1,10 @@
import React, { ComponentType } from 'react';
import { Route, Redirect, RouteProps } from 'react-router-dom';
import { Location } from 'history';
import { connect } from 'react-redux';
import { connect } from 'app/functions';
import { getActiveAccount } from 'app/components/accounts/reducer';
import { Account } from 'app/components/accounts';
import { RootState } from 'app/reducers';
interface Props extends RouteProps {
component: ComponentType<any>;
@@ -20,6 +20,6 @@ const PrivateRoute = ({ account, component: Component, ...rest }: Props) => (
/>
);
export default connect((state: RootState) => ({
export default connect((state) => ({
account: getActiveAccount(state),
}))(PrivateRoute);