mirror of
https://github.com/usatiuk/writer.git
synced 2025-10-28 16:07:49 +01:00
cleanup app.tsx
This commit is contained in:
@@ -18,12 +18,10 @@ interface IAppComponentProps extends RouteComponentProps {
|
|||||||
|
|
||||||
export function AppComponent(props: IAppComponentProps) {
|
export function AppComponent(props: IAppComponentProps) {
|
||||||
const { loggedIn } = props;
|
const { loggedIn } = props;
|
||||||
const { location } = props.history;
|
|
||||||
return loggedIn ? (
|
return loggedIn ? (
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route path="/signup" component={AuthScreen} />,
|
<Route path="/signup" component={AuthScreen} />,
|
||||||
<Route path="/login" component={AuthScreen} />,
|
<Route path="/login" component={AuthScreen} />,
|
||||||
<Route path="/docs/:id" component={Home} />,
|
|
||||||
<Route path="/" component={Home} />,
|
<Route path="/" component={Home} />,
|
||||||
</Switch>
|
</Switch>
|
||||||
) : (
|
) : (
|
||||||
@@ -37,7 +35,7 @@ export function AppComponent(props: IAppComponentProps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mapStateToProps(state: IAppState) {
|
function mapStateToProps(state: IAppState) {
|
||||||
return { loggedIn: !(state.auth.jwt === null) };
|
return { loggedIn: state.auth.jwt !== null };
|
||||||
}
|
}
|
||||||
|
|
||||||
export const App = withRouter(connect(mapStateToProps)(AppComponent));
|
export const App = withRouter(connect(mapStateToProps)(AppComponent));
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"typescriptHero.imports.stringQuoteStyle": "\"",
|
"typescriptHero.imports.stringQuoteStyle": "\"",
|
||||||
"files.exclude": {
|
"files.exclude": {
|
||||||
"**/node_modules": true
|
"**/node_modules": true
|
||||||
}
|
},
|
||||||
|
"typescript.tsdk": "writer/node_modules/typescript/lib"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user