-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add view all contracts (#1235)
* chore: update README * feat: add suggested messages for execute contract * chore: add suggested inputs for execute * chore: execute contract messages * chore: update message suggestion logic * chore: add list codes and contracts * chore * chore: add all contracts option * chore: review changes * chore: review changes * chore * chore: review changes
- Loading branch information
1 parent
4a0af23
commit c1939db
Showing
26 changed files
with
1,294 additions
and
175 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
27 changes: 25 additions & 2 deletions
27
frontend/src/app/(routes)/cosmwasm/components/AllContracts.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 |
---|---|---|
@@ -1,7 +1,30 @@ | ||
import useGetChainInfo from '@/custom-hooks/useGetChainInfo'; | ||
import { useSearchParams } from 'next/navigation'; | ||
import React from 'react'; | ||
import Contracts from './all-contracts/Contracts'; | ||
import Codes from './all-contracts/Codes'; | ||
|
||
const AllContracts = () => { | ||
return <div className="h-1/2 flex-center-center">Comming Soon...</div>; | ||
const AllContracts = (props: { chainID: string }) => { | ||
const { chainID } = props; | ||
const { getChainInfo } = useGetChainInfo(); | ||
const { restURLs, chainName } = getChainInfo(chainID); | ||
|
||
const selectedCodeId = useSearchParams().get('code_id'); | ||
|
||
return ( | ||
<div> | ||
{selectedCodeId ? ( | ||
<Contracts | ||
codeId={selectedCodeId} | ||
chainID={chainID} | ||
baseURLs={restURLs} | ||
chainName={chainName} | ||
/> | ||
) : ( | ||
<Codes chainID={chainID} baseURLs={restURLs} /> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AllContracts; |
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
67 changes: 67 additions & 0 deletions
67
frontend/src/app/(routes)/cosmwasm/components/DialogAddressesList.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,67 @@ | ||
import CommonCopy from '@/components/CommonCopy'; | ||
import { dialogBoxPaperPropStyles } from '@/utils/commonStyles'; | ||
import { CLOSE_ICON_PATH } from '@/utils/constants'; | ||
import { Dialog, DialogContent } from '@mui/material'; | ||
import Image from 'next/image'; | ||
import React from 'react'; | ||
|
||
const DialogAddressesList = ({ | ||
addresses, | ||
onClose, | ||
open, | ||
}: { | ||
open: boolean; | ||
onClose: () => void; | ||
addresses: string[]; | ||
}) => { | ||
const handleDialogClose = () => { | ||
onClose(); | ||
}; | ||
return ( | ||
<Dialog | ||
open={open} | ||
onClose={handleDialogClose} | ||
maxWidth="lg" | ||
PaperProps={{ | ||
sx: dialogBoxPaperPropStyles, | ||
}} | ||
> | ||
<DialogContent sx={{ padding: 0 }}> | ||
<div className="w-[890px] text-white"> | ||
<div className="px-10 pb-6 pt-10 flex justify-end"> | ||
<div onClick={onClose}> | ||
<Image | ||
className="cursor-pointer" | ||
src={CLOSE_ICON_PATH} | ||
width={24} | ||
height={24} | ||
alt="close" | ||
draggable={false} | ||
/> | ||
</div> | ||
</div> | ||
<div className="px-10 space-y-4 pb-10"> | ||
<div className="space-y-1"> | ||
<div className="flex items-center text-white text-xl not-italic font-bold leading-[normal]"> | ||
Allowed Addresses | ||
</div> | ||
<div className="text-[12px] font-light"> | ||
List of addresses that are allowed to instantiate contract{' '} | ||
</div> | ||
</div> | ||
<div className="divider-line"></div> | ||
<div className="flex flex-wrap gap-4"> | ||
{addresses.map((address) => ( | ||
<div key={address}> | ||
<CommonCopy message={address} style="" plainIcon={true} /> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
}; | ||
|
||
export default DialogAddressesList; |
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.