Skip to content

Commit

Permalink
fix: prevent rendering of governance banner if KYC is not approved (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
flopez7 authored Feb 27, 2025
1 parent 92edc87 commit b78f3a8
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ import { useTranslation } from 'react-i18next';
import { env } from '@/shared/env';
import { useColorMode } from '@/shared/contexts/color-mode';
import { useIsMobile } from '@/shared/hooks/use-is-mobile';
import { useWorkerKycStatus } from '@/modules/worker/profile/hooks';
import { useActiveProposalQuery } from '../hooks/use-active-proposal-query';

export function GovernanceBanner() {
const { t } = useTranslation();
const { data, isLoading, isError } = useActiveProposalQuery();
const { kycApproved } = useWorkerKycStatus();
const { colorPalette } = useColorMode();
const [timeRemaining, setTimeRemaining] = useState('00:00:00');
const isMobile = useIsMobile('lg');
Expand Down Expand Up @@ -41,7 +43,7 @@ export function GovernanceBanner() {
};
}, [data?.deadline]);

if (isLoading || isError || !data) {
if (!kycApproved || isLoading || isError || !data) {
return null;
}

Expand Down

0 comments on commit b78f3a8

Please sign in to comment.