thunderhub/pages/index.tsx
Anthony Potdevin aa60d618f9
Feat/nextjs (#25)
* feat: initial nextjs commit

* chore: general card styles changes

* chore: add storybook

* chore: small changes and fixes

* fix: trading filter encoding

* fix: add link to node

* chore: set to correct version
2020-04-12 18:27:01 +02:00

21 lines
646 B
TypeScript

// import App from 'next/app';
import React from 'react';
import { useAccount } from '../src/context/AccountContext';
import { SessionLogin } from '../src/views/login/SessionLogin';
import { useRouter } from 'next/router';
import { HomePageView } from '../src/views/homepage/HomePage';
const ContextApp: React.FC = () => {
const { push } = useRouter();
const { loggedIn, admin, viewOnly, sessionAdmin } = useAccount();
if (loggedIn) {
if (admin === '' || viewOnly !== '' || sessionAdmin !== '') {
push('/home');
}
}
return !loggedIn && admin === '' ? <HomePageView /> : <SessionLogin />;
};
export default ContextApp;