-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding validatino when no connected * AutoFocus on editContractName
- Loading branch information
1 parent
621c25a
commit fed68b1
Showing
7 changed files
with
224 additions
and
143 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
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,86 @@ | ||
import { Box, Typography } from '@mui/material' | ||
import React from 'react' | ||
import { UserContractDetails } from '@/domain' | ||
import BasicTabs from '@/components/Tabs' | ||
import SimpleAccordion from '@/components/Accordion' | ||
|
||
type ContractTabType = 'Read Contract' | 'Write Contract' | ||
const types: ContractTabType[] = ['Read Contract', 'Write Contract'] | ||
|
||
interface Props { | ||
userContract: UserContractDetails | ||
} | ||
|
||
export function ContractDetailsInteraction({ userContract }: Props) { | ||
const [type, setType] = React.useState(types[0]) | ||
const isReadContract = type === 'Read Contract' | ||
|
||
const handleChange = (newValue: number) => { | ||
setType(types[newValue]) | ||
} | ||
|
||
return ( | ||
<> | ||
<Box sx={{ width: '100%' }}> | ||
<BasicTabs | ||
options={['Read Contract', 'Write Contract']} | ||
onChange={handleChange} | ||
> | ||
<> | ||
{/* <Typography variant="h4">{type}</Typography> */} | ||
{isReadContract ? ( | ||
<> | ||
<Typography variant="h4"> | ||
Learn more about your contract 🔁 | ||
</Typography> | ||
<Typography variant="body1"> | ||
Let'start to work with your contract displaying each | ||
method. | ||
</Typography> | ||
</> | ||
) : ( | ||
<> | ||
<Typography variant="h4"> | ||
Interact with your contract 🔁 | ||
</Typography> | ||
<Typography variant="body1"> | ||
Let's start to work with your contract doing different | ||
querys. | ||
</Typography> | ||
</> | ||
)} | ||
<SimpleAccordion | ||
elements={ | ||
isReadContract | ||
? [ | ||
{ | ||
tittle: 'psp22::balance', | ||
content: 'text balance', | ||
id: '1' | ||
}, | ||
{ | ||
tittle: 'psp22::owners', | ||
content: 'text owners', | ||
id: '2' | ||
} | ||
] | ||
: [ | ||
{ | ||
tittle: 'psp22::approve', | ||
content: 'Form approve', | ||
id: '1' | ||
}, | ||
{ | ||
tittle: 'psp22::tranfer', | ||
content: 'Form transfer', | ||
id: '2' | ||
} | ||
] | ||
} | ||
/> | ||
</> | ||
</BasicTabs> | ||
</Box> | ||
</> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.