From 326ffb72a108a5c75e855944b2576088c30a324c Mon Sep 17 00:00:00 2001 From: Johnny D Date: Thu, 14 Sep 2023 15:20:51 +1000 Subject: [PATCH] Dev blocked projects and block Metakeys copy-cat (#4067) Co-authored-by: peripheralist --- .../ProjectDashboard/ProjectDashboard.tsx | 2 ++ .../components/BlockedProjectBanner.tsx | 29 +++++++++++++++++++ .../PayProjectCard/PayProjectCard.tsx | 5 +++- src/constants/blocklist.ts | 16 ++++++++++ src/hooks/useBlockedProject.ts | 12 ++++++++ src/hooks/useProjects.ts | 15 ++++++++-- src/locales/messages.pot | 6 ++++ 7 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 src/components/ProjectDashboard/components/BlockedProjectBanner.tsx create mode 100644 src/constants/blocklist.ts create mode 100644 src/hooks/useBlockedProject.ts diff --git a/src/components/ProjectDashboard/ProjectDashboard.tsx b/src/components/ProjectDashboard/ProjectDashboard.tsx index 00ccf60e62..b048ce7327 100644 --- a/src/components/ProjectDashboard/ProjectDashboard.tsx +++ b/src/components/ProjectDashboard/ProjectDashboard.tsx @@ -2,6 +2,7 @@ import { Footer } from 'components/Footer' import { TransactionProvider } from 'contexts/Transaction/TransactionProvider' import { useHasNftRewards } from 'hooks/JB721Delegate/useHasNftRewards' import { twMerge } from 'tailwind-merge' +import { BlockedProjectBanner } from './components/BlockedProjectBanner' import { Cart } from './components/Cart' import { CoverPhoto } from './components/CoverPhoto' import { CurrentBalanceCard } from './components/CurrentBalanceCard' @@ -35,6 +36,7 @@ export const ProjectDashboard = () => {
+
+ Delisted project} + body={ + + This project has been delisted for breaching our{' '} + policy.{' '} + Get in touch. + + } + variant="warning" + /> +
+ ) +} diff --git a/src/components/ProjectDashboard/components/PayProjectCard/PayProjectCard.tsx b/src/components/ProjectDashboard/components/PayProjectCard/PayProjectCard.tsx index 0ad6cb0d1f..45621b335f 100644 --- a/src/components/ProjectDashboard/components/PayProjectCard/PayProjectCard.tsx +++ b/src/components/ProjectDashboard/components/PayProjectCard/PayProjectCard.tsx @@ -6,6 +6,7 @@ import { Trans, t } from '@lingui/macro' import { Button, Tooltip } from 'antd' import { usePayProjectCard } from 'components/ProjectDashboard/hooks' import { Formik } from 'formik' +import { useV2BlockedProject } from 'hooks/useBlockedProject' import { V2V3CurrencyOption } from 'models/v2v3/currencyOption' import { twMerge } from 'tailwind-merge' import { V2V3_CURRENCY_ETH } from 'utils/v2v3/currency' @@ -14,6 +15,8 @@ import { PayInput } from './components/PayInput' import { TokensPerEth } from './components/TokensPerEth' export const PayProjectCard = ({ className }: { className?: string }) => { + const isBlockedProject = useV2BlockedProject() + const { validationSchema, paymentsPaused, addPay } = usePayProjectCard() const determiningIfProjectCanReceivePayments = paymentsPaused === undefined @@ -74,7 +77,7 @@ export const PayProjectCard = ({ className }: { className?: string }) => { >