diff --git a/app/partnerAdminSlice.tsx b/app/partnerAdminSlice.tsx index c76f5cc82..9cd5803a5 100644 --- a/app/partnerAdminSlice.tsx +++ b/app/partnerAdminSlice.tsx @@ -4,6 +4,7 @@ import { api, GetUserResponse } from './api'; export interface PartnerAdmin { id: string | null; + active: boolean | null; createdAt: Date | null; updatedAt: Date | null; partner: PartnerContent | null; @@ -11,6 +12,7 @@ export interface PartnerAdmin { const initialState: PartnerAdmin = { id: null, + active: null, createdAt: null, updatedAt: null, partner: null, diff --git a/guards/partnerAdminGuard.tsx b/guards/partnerAdminGuard.tsx index 28296e208..ab7025517 100644 --- a/guards/partnerAdminGuard.tsx +++ b/guards/partnerAdminGuard.tsx @@ -1,7 +1,7 @@ import { Container, Typography } from '@mui/material'; import { Box } from '@mui/system'; import Head from 'next/head'; -import Image from "next/image"; +import Image from 'next/image'; import { useTranslations } from 'use-intl'; import Link from '../components/common/Link'; import { useTypedSelector } from '../hooks/store'; @@ -22,11 +22,12 @@ const imageContainerStyle = { export function PartnerAdminGuard({ children }: { children: JSX.Element }) { const partnerAdminId = useTypedSelector((state) => state.partnerAdmin.id); + const partnerAdminIsActive = useTypedSelector((state) => state.partnerAdmin.active); const t = useTranslations('PartnerAdmin.accessGuard'); const tS = useTranslations('Shared'); - if (!partnerAdminId) { + if (!partnerAdminId || !partnerAdminIsActive) { return ( {t('title')} @@ -37,8 +38,9 @@ export function PartnerAdminGuard({ children }: { children: JSX.Element }) { fill sizes="100vw" style={{ - objectFit: "contain" - }} /> + objectFit: 'contain', + }} + /> {t('title')}