-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7dc5c60
commit 293eb82
Showing
21 changed files
with
498 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
packages/apps/rwa-demo/src/components/HomePage/ComplianceOwnerRootPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
'use client'; | ||
import { SetMaxBalanceForm } from '@/components/SetMaxBalanceForm/SetMaxBalanceForm'; | ||
import { SideBarBreadcrumbs } from '@/components/SideBarBreadcrumbs/SideBarBreadcrumbs'; | ||
import { useAccount } from '@/hooks/account'; | ||
import { useAsset } from '@/hooks/asset'; | ||
import { MonoAdd } from '@kadena/kode-icons'; | ||
import { Button, Stack } from '@kadena/kode-ui'; | ||
import { useLayout } from '@kadena/kode-ui/patterns'; | ||
import { useState } from 'react'; | ||
import { SetMaxSupplyForm } from '../SetMaxSupplyForm/SetMaxSupplyForm'; | ||
|
||
export const ComplianceOwnerRootPage = () => { | ||
const { isComplianceOwner } = useAccount(); | ||
const { setIsRightAsideExpanded, isRightAsideExpanded } = useLayout(); | ||
const { paused } = useAsset(); | ||
const [hasOpenMaxBalanceForm, setHasOpenMaxBalanceForm] = useState(false); | ||
const [hasOpenMaxSupplyForm, setHasOpenMaxSupplyForm] = useState(false); | ||
|
||
const handleMaxBalanceForm = () => { | ||
setIsRightAsideExpanded(true); | ||
setHasOpenMaxBalanceForm(true); | ||
}; | ||
const handleMaxSupplyForm = () => { | ||
setIsRightAsideExpanded(true); | ||
setHasOpenMaxSupplyForm(true); | ||
}; | ||
|
||
return ( | ||
<Stack width="100%" flexDirection="column" gap="md"> | ||
<SideBarBreadcrumbs /> | ||
|
||
{isRightAsideExpanded && hasOpenMaxBalanceForm && ( | ||
<SetMaxBalanceForm | ||
onClose={() => { | ||
setIsRightAsideExpanded(false); | ||
setHasOpenMaxBalanceForm(false); | ||
}} | ||
/> | ||
)} | ||
{isRightAsideExpanded && hasOpenMaxSupplyForm && ( | ||
<SetMaxSupplyForm | ||
onClose={() => { | ||
setIsRightAsideExpanded(false); | ||
setHasOpenMaxSupplyForm(false); | ||
}} | ||
/> | ||
)} | ||
|
||
<Stack gap="sm"> | ||
{isComplianceOwner && ( | ||
<> | ||
<Button | ||
isDisabled={paused} | ||
startVisual={<MonoAdd />} | ||
onClick={handleMaxBalanceForm} | ||
> | ||
Set Max Balance | ||
</Button> | ||
<Button | ||
isDisabled={paused} | ||
startVisual={<MonoAdd />} | ||
onClick={handleMaxSupplyForm} | ||
> | ||
Set Max Supply | ||
</Button> | ||
</> | ||
)} | ||
</Stack> | ||
</Stack> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 1 addition & 34 deletions
35
packages/apps/rwa-demo/src/components/HomePage/OwnerRootPage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.