From a90a8964357f53ffe3637c86d189c8b5092651af Mon Sep 17 00:00:00 2001 From: ikprk <168457495+ikprk@users.noreply.github.com> Date: Fri, 19 Jul 2024 11:01:52 +0200 Subject: [PATCH] :rescue_worker_helmet: Revenue share amm restriction (#6416) * Add new hook to unify the token lock logic * Implement new hook throughout the app * Correct logic to follow runtime --- .../BuyFromMarketButton/BuyFromMarketButton.tsx | 6 +++--- .../BuyMarketTokenModal/BuyMarketTokenModal.tsx | 17 ++++++++--------- .../_crt/CrtStatusWidget/CrtStatusWidget.tsx | 10 ++++------ .../SellOnMarketButton/SellOnMarketButton.tsx | 6 +++--- .../_crt/SellTokenModal/SellTokenModal.tsx | 16 +++++++--------- .../atlas/src/hooks/useIsTokenInLockedMode.ts | 16 ++++++++++++++++ 6 files changed, 41 insertions(+), 30 deletions(-) create mode 100644 packages/atlas/src/hooks/useIsTokenInLockedMode.ts diff --git a/packages/atlas/src/components/_crt/BuyFromMarketButton/BuyFromMarketButton.tsx b/packages/atlas/src/components/_crt/BuyFromMarketButton/BuyFromMarketButton.tsx index 61587e88bc..850881856e 100644 --- a/packages/atlas/src/components/_crt/BuyFromMarketButton/BuyFromMarketButton.tsx +++ b/packages/atlas/src/components/_crt/BuyFromMarketButton/BuyFromMarketButton.tsx @@ -6,17 +6,17 @@ import { BuyMarketTokenModal } from '@/components/_crt/BuyMarketTokenModal' type BuyFromMarketButtonProps = { tokenId: string - hasActiveRevenueShare?: boolean + isTokenLocked?: boolean } -export const BuyFromMarketButton = ({ tokenId, hasActiveRevenueShare }: BuyFromMarketButtonProps) => { +export const BuyFromMarketButton = ({ tokenId, isTokenLocked }: BuyFromMarketButtonProps) => { const [showModal, setShowModal] = useState(false) return ( <> setShowModal(false)} />