upgrade to react18

This commit is contained in:
Proddy
2022-05-22 13:57:17 +02:00
parent e8387b363f
commit 22668d76ee
13 changed files with 2491 additions and 1725 deletions

View File

@@ -2,8 +2,9 @@ import { FC, useContext } from 'react';
import { Navigate } from 'react-router-dom';
import { AuthenticatedContext } from '../../contexts/authentication';
import { RequiredChildrenProps } from '../../utils';
const RequireAdmin: FC = ({ children }) => {
const RequireAdmin: FC<RequiredChildrenProps> = ({ children }) => {
const authenticatedContext = useContext(AuthenticatedContext);
return authenticatedContext.me.admin ? <>{children}</> : <Navigate replace to="/" />;
};