From 53427815d7465d7a244d4cb9dd46cbef20d19be8 Mon Sep 17 00:00:00 2001 From: Steven Straatemans Date: Tue, 10 Dec 2024 14:25:49 +0100 Subject: [PATCH] disable pausebutton for all except agent --- packages/apps/rwa-demo/src/app/(app)/page.tsx | 4 +++- .../src/components/PauseForm/PauseAssetAction.tsx | 10 +++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/apps/rwa-demo/src/app/(app)/page.tsx b/packages/apps/rwa-demo/src/app/(app)/page.tsx index 68e434988c..d70d756c93 100644 --- a/packages/apps/rwa-demo/src/app/(app)/page.tsx +++ b/packages/apps/rwa-demo/src/app/(app)/page.tsx @@ -10,6 +10,7 @@ import { SupplyCount } from '@/components/SupplyCount/SupplyCount'; import { TransferForm } from '@/components/TransferForm/TransferForm'; import { useAccount } from '@/hooks/account'; import { useAsset } from '@/hooks/asset'; +import { useFreeze } from '@/hooks/freeze'; import { MonoAdd, MonoEditNote } from '@kadena/kode-icons'; import { Button, Stack } from '@kadena/kode-ui'; import { @@ -21,6 +22,7 @@ import { const Home = () => { const { isInvestor, isComplianceOwner, account } = useAccount(); + const { frozen } = useFreeze({ investorAccount: account?.address }); const { paused, asset } = useAsset(); return ( @@ -66,7 +68,7 @@ const Home = () => { } label="Transfer tokens" /> diff --git a/packages/apps/rwa-demo/src/components/PauseForm/PauseAssetAction.tsx b/packages/apps/rwa-demo/src/components/PauseForm/PauseAssetAction.tsx index 8cb6b95e9b..ef2d882365 100644 --- a/packages/apps/rwa-demo/src/components/PauseForm/PauseAssetAction.tsx +++ b/packages/apps/rwa-demo/src/components/PauseForm/PauseAssetAction.tsx @@ -1,3 +1,4 @@ +import { useAccount } from '@/hooks/account'; import { useAsset } from '@/hooks/asset'; import { MonoPause, MonoPlayArrow } from '@kadena/kode-icons'; import { useState } from 'react'; @@ -7,6 +8,7 @@ import { PauseForm } from './PauseForm'; export const PauseAssetAction = () => { const { paused } = useAsset(); + const { isAgent } = useAccount(); const [loading, setLoading] = useState(false); const showIcon = () => { @@ -19,7 +21,13 @@ export const PauseAssetAction = () => { return ( } + trigger={ + + } /> ); };