mirror of
https://github.com/apotdevin/thunderhub.git
synced 2025-02-23 14:40:27 +01:00
* test: change docker to yarn
* test: change api handler url
* fix: image imports in public folder
* fix: add path prefix to links
* chore: update deps
* chore: small fixes
* chore: remove prefetch flag
* chore: remove use size hook
* Revert "chore: remove prefetch flag"
This reverts commit ae7ee3bc23
.
22 lines
718 B
TypeScript
22 lines
718 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';
|
|
import { appendBasePath } from '../src/utils/basePath';
|
|
|
|
const ContextApp: React.FC = () => {
|
|
const { push } = useRouter();
|
|
const { loggedIn, admin, viewOnly, sessionAdmin } = useAccount();
|
|
|
|
if (loggedIn) {
|
|
if (admin === '' || viewOnly !== '' || sessionAdmin !== '') {
|
|
push(appendBasePath('/home'));
|
|
}
|
|
}
|
|
|
|
return !loggedIn && admin === '' ? <HomePageView /> : <SessionLogin />;
|
|
};
|
|
|
|
export default ContextApp;
|