Fixed some todos and added the start of the dashboard

This commit is contained in:
2020-02-22 17:03:53 +01:00
parent 9dc003c9b0
commit 6ca0a99e78
12 changed files with 11010 additions and 14565 deletions
@@ -1,7 +1,40 @@
import React from 'react';
import DashboardView from '../../Views/DashboardView'
export default class Dashboard extends React.Component<{
history: any
}, {
dto: any
}> {
state!: {
dto: {
API_Link: string | null;
API_Token: string | null;
};
};
props: any;
constructor(props: any) {
super(props);
if (props.location.state.dto !== undefined) {
// If the state exists being routed from /, fill in Dashboard State.
this.state = { dto: props.location.state.dto };
} else if (localStorage.getItem("APILink") !== null &&
localStorage.getItem("AccessToken") !== null) {
// Check if localStorage has valid items, if this is the case, we can use those.
// Resolve issue with cold navigation to /dashboard.
this.state = {
dto: {
API_Link: localStorage.getItem("APILink"),
API_Token: localStorage.getItem("AccessToken")
}
}
} else {
// Route back to / if neither is the case.
this.props.history.push('/');
}
}
export default class Dashboard extends React.Component {
render () {
return (<h1> This is the dashboard, fuck yeah </h1>)
return (<DashboardView />)
}
}