Skip to content

Commit

Permalink
fix: apply review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
spaenleh committed Jul 22, 2024
1 parent 3c2f30f commit 7abd0e2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/alerts/MemberValidationBanner.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useState } from 'react';
import { Link } from 'react-router-dom';

import {
Expand All @@ -19,6 +18,8 @@ import {
} from '@/config/selectors';
import { BUILDER } from '@/langs/constants';

import useModalStatus from '../hooks/useModalStatus';

const DOCUMENTATION_ORIGIN = 'https://graasp.github.io/docs';
const MEMBER_VALIDATION_DOCUMENTATION_LINK = '/user/account/validation';
const buildLocalizedDocumentationOrigin = (lang: string = 'en') => {
Expand All @@ -36,20 +37,21 @@ const buildLocalizedDocumentationLink = (lang: string): string => {
};

const MemberValidationBanner = (): JSX.Element | false => {
const [open, setOpen] = useState(true);
const { isOpen, closeModal } = useModalStatus({
isInitiallyOpen: true,
});
const { t, i18n } = useBuilderTranslation();
const { data: member } = hooks.useCurrentMember();
if (open && member?.isValidated !== true) {

if (isOpen && !member?.isValidated) {
return (
<Alert
id={MEMBER_VALIDATION_BANNER_ID}
severity="warning"
action={
<IconButton
id={MEMBER_VALIDATION_BANNER_CLOSE_BUTTON_ID}
onClick={() => {
setOpen(false);
}}
onClick={closeModal}
>
<XIcon />
</IconButton>
Expand Down

0 comments on commit 7abd0e2

Please sign in to comment.