cleanup app.tsx

This commit is contained in:
2019-06-26 22:55:00 +03:00
parent 5f5bd3da96
commit 2a43c3009f
2 changed files with 3 additions and 4 deletions

View File

@@ -18,12 +18,10 @@ interface IAppComponentProps extends RouteComponentProps {
export function AppComponent(props: IAppComponentProps) {
const { loggedIn } = props;
const { location } = props.history;
return loggedIn ? (
<Switch>
<Route path="/signup" component={AuthScreen} />,
<Route path="/login" component={AuthScreen} />,
<Route path="/docs/:id" component={Home} />,
<Route path="/" component={Home} />,
</Switch>
) : (
@@ -37,7 +35,7 @@ export function AppComponent(props: IAppComponentProps) {
}
function mapStateToProps(state: IAppState) {
return { loggedIn: !(state.auth.jwt === null) };
return { loggedIn: state.auth.jwt !== null };
}
export const App = withRouter(connect(mapStateToProps)(AppComponent));

View File

@@ -11,6 +11,7 @@
"typescriptHero.imports.stringQuoteStyle": "\"",
"files.exclude": {
"**/node_modules": true
}
},
"typescript.tsdk": "writer/node_modules/typescript/lib"
}
}