mirror of
https://github.com/apotdevin/thunderhub.git
synced 2025-02-22 14:22:33 +01:00
* 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
21 lines
646 B
TypeScript
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;
|