diff --git a/src/view/ContractDetailView/ContractInteractionForm/ReadMethodsForm.tsx b/src/view/ContractDetailView/ContractInteractionForm/ReadMethodsForm.tsx index cccd7a04..70a7148f 100644 --- a/src/view/ContractDetailView/ContractInteractionForm/ReadMethodsForm.tsx +++ b/src/view/ContractDetailView/ContractInteractionForm/ReadMethodsForm.tsx @@ -1,17 +1,12 @@ import { useEffect } from 'react' import { ContractInteractionProps } from '.' -import { - Box, - CircularProgress, - Stack, - Typography, - FormHelperText -} from '@mui/material' +import { Box, Stack, Typography } from '@mui/material' import { MethodDocumentation } from '../MethodDocumentation' import { AbiParam } from '@/services/substrate/types' import { ButtonCall } from './styled' import { useContractCaller } from '@/hooks/useContractCaller' -import { CopyBlock, atomOneDark } from 'react-code-blocks' +import { getDecodedOutput } from '@/utils/contractExecResult' +import { CopyToClipboardButton, StyledTextField } from '@/view/components' type Props = React.PropsWithChildren< Omit & { @@ -49,11 +44,13 @@ export function ReadMethodsForm({ > <> - {abiParams.length > 0 && Message to send} + {abiParams.length > 0 && ( + Message to send + )} {children} - Outcome + Outcome @@ -65,27 +62,36 @@ export function ReadMethodsForm({ justifyContent: 'center' }} > - {caller.isSubmitting ? ( - - ) : ( - <> - + + + - {error && ( - - {error} - - )} - - )} + + caller.send(inputData)} + > + Recall + + - caller.send(inputData)}>Recall diff --git a/src/view/ContractDetailView/ContractInteractionForm/WriteMethodsForm.tsx b/src/view/ContractDetailView/ContractInteractionForm/WriteMethodsForm.tsx index 3fe88540..ba565e8d 100644 --- a/src/view/ContractDetailView/ContractInteractionForm/WriteMethodsForm.tsx +++ b/src/view/ContractDetailView/ContractInteractionForm/WriteMethodsForm.tsx @@ -35,11 +35,13 @@ export function WriteMethodsForm({ > <> - {abiParams.length > 0 && Message to send} + {abiParams.length > 0 && ( + Message to send + )} {children} - Outcome + Outcome diff --git a/src/view/ContractDetailView/ContractInteractionForm/styled.ts b/src/view/ContractDetailView/ContractInteractionForm/styled.ts index f050ef78..4b3546f0 100644 --- a/src/view/ContractDetailView/ContractInteractionForm/styled.ts +++ b/src/view/ContractDetailView/ContractInteractionForm/styled.ts @@ -1,10 +1,17 @@ import { LoadingButton, LoadingButtonProps } from '@/view/components' -import styled from '@emotion/styled' +import { styled } from '@mui/material/styles' -export const ButtonCall = styled(LoadingButton)(() => ({ - fontSize: '1rem', - height: '2.5rem', - borderRadius: '1.5rem', - textTransform: 'none', - border: 'none' -})) +export const ButtonCall = styled(LoadingButton)( + ({ theme }) => ({ + fontSize: '1rem', + height: '2.5rem', + borderRadius: '1.5rem', + textTransform: 'none', + border: theme.palette.primary.main, + background: theme.palette.primary.main, + color: theme.palette.common.white, + '& .MuiCircularProgress-root': { + color: theme.palette.common.white + } + }) +) diff --git a/src/view/ContractDetailView/ContractsTabInteraction.tsx b/src/view/ContractDetailView/ContractsTabInteraction.tsx index 34fbe06c..9faccc18 100644 --- a/src/view/ContractDetailView/ContractsTabInteraction.tsx +++ b/src/view/ContractDetailView/ContractsTabInteraction.tsx @@ -10,7 +10,7 @@ import { import { useContractPromiseFromSource } from '@/hooks/useContractPromise' import { FallbackSpinner } from '@/components/FallbackSpinner' import { ContractPromise, Registry } from '@/services/substrate/types' -import { ContractInteractionForm } from './ContractInteractionForm' +import { ContractInteractionForm } from '@/view/ContractDetailView/ContractInteractionForm' const types: ContractTabType[] = ['Read Contract', 'Write Contract'] const groupedIndex: Record = { @@ -93,8 +93,8 @@ export function ContractsTabInteraction({ userContract }: Props) { @@ -105,8 +105,8 @@ export function ContractsTabInteraction({ userContract }: Props) { Learn more about your contract 🔁 - Let'start to work with your contract displaying each - method. + Explore the smart contract's data by selecting the + desired information. ) : ( @@ -115,8 +115,8 @@ export function ContractsTabInteraction({ userContract }: Props) { Interact with your contract 🔁 - Let's start to work with your contract doing different - querys. + Select the method you want to execute and fill in the required + parameters to perform a transaction. )} diff --git a/src/view/ContractDetailView/MethodDocumentation.tsx b/src/view/ContractDetailView/MethodDocumentation.tsx index ba14ec97..9bcde253 100644 --- a/src/view/ContractDetailView/MethodDocumentation.tsx +++ b/src/view/ContractDetailView/MethodDocumentation.tsx @@ -13,14 +13,13 @@ export function MethodDocumentation({ abiMessage }: Props) { borderColor: 'primary.main', borderRadius: '0.5rem', borderStyle: 'solid', - p: 2, - bgcolor: 'background.paper' + p: 2 }} > {abiMessage.method} - {abiMessage.docs} + {abiMessage.docs} ) } diff --git a/src/view/CustomContracts/detail/SkeletonContractDetail.tsx b/src/view/CustomContracts/detail/SkeletonContractDetail.tsx index 94f9d676..ffbd118b 100644 --- a/src/view/CustomContracts/detail/SkeletonContractDetail.tsx +++ b/src/view/CustomContracts/detail/SkeletonContractDetail.tsx @@ -6,13 +6,25 @@ import MainContainer from '@/view/layout/MainContainer' export function ContractDetailSkeleton() { return ( - - - - - - + + + + + + + + + + + @@ -24,8 +36,8 @@ export function ContractDetailSkeleton() { - - + + diff --git a/src/view/components/Accordion/index.tsx b/src/view/components/Accordion/index.tsx index 7ca16d4e..4156764c 100644 --- a/src/view/components/Accordion/index.tsx +++ b/src/view/components/Accordion/index.tsx @@ -33,7 +33,7 @@ export default function SimpleAccordion({ } return ( - + {elements.map(row => ( > = ({ ...sx }} > - - {label} - + {label} {_children} ) diff --git a/src/view/components/FactoryInputArgument/ArgBooleanSelect.tsx b/src/view/components/FactoryInputArgument/ArgBooleanSelect.tsx index d61d0d21..edf66bf4 100644 --- a/src/view/components/FactoryInputArgument/ArgBooleanSelect.tsx +++ b/src/view/components/FactoryInputArgument/ArgBooleanSelect.tsx @@ -20,9 +20,18 @@ export function ArgBooleanSelect({ return ( <> {label} - + + True + + + False + ) diff --git a/src/view/components/FactoryInputArgument/ArgEnum.tsx b/src/view/components/FactoryInputArgument/ArgEnum.tsx index caf4ff9e..2260d36e 100644 --- a/src/view/components/FactoryInputArgument/ArgEnum.tsx +++ b/src/view/components/FactoryInputArgument/ArgEnum.tsx @@ -71,6 +71,7 @@ export function ArgEnum({ />