Commit 6e965de6 authored by tom's avatar tom

fixes

parent 860e688e
...@@ -15,6 +15,10 @@ const semanticTokens = { ...@@ -15,6 +15,10 @@ const semanticTokens = {
link_hovered: { link_hovered: {
'default': 'blue.400', 'default': 'blue.400',
}, },
error: {
'default': 'red.400',
_dark: 'red.300',
},
}, },
}; };
......
...@@ -85,7 +85,7 @@ const ContractWriteResultDumb = ({ result, onSettle, txInfo }: Props) => { ...@@ -85,7 +85,7 @@ const ContractWriteResultDumb = ({ result, onSettle, txInfo }: Props) => {
alignItems="center" alignItems="center"
whiteSpace="pre-wrap" whiteSpace="pre-wrap"
wordBreak="break-all" wordBreak="break-all"
color={ txInfo.status === 'error' || isErrorResult ? 'red.600' : undefined } color={ txInfo.status === 'error' || isErrorResult ? 'error' : undefined }
> >
{ content } { content }
</Box> </Box>
......
...@@ -59,7 +59,6 @@ const ContractVerificationForm = () => { ...@@ -59,7 +59,6 @@ const ContractVerificationForm = () => {
size="lg" size="lg"
type="submit" type="submit"
mt={ 12 } mt={ 12 }
isDisabled={ !formState.isValid || !formState.isDirty }
isLoading={ formState.isSubmitting } isLoading={ formState.isSubmitting }
loadingText="Verify & publish" loadingText="Verify & publish"
> >
......
...@@ -37,6 +37,7 @@ const ContractVerificationFieldLibraryItem = ({ control, index, fieldsLength, on ...@@ -37,6 +37,7 @@ const ContractVerificationFieldLibraryItem = ({ control, index, fieldsLength, on
required required
isInvalid={ Boolean(error?.name) } isInvalid={ Boolean(error?.name) }
maxLength={ 255 } maxLength={ 255 }
autoComplete="off"
/> />
<InputPlaceholder text="Library name (.sol file)" error={ error?.name }/> <InputPlaceholder text="Library name (.sol file)" error={ error?.name }/>
</FormControl> </FormControl>
...@@ -50,6 +51,7 @@ const ContractVerificationFieldLibraryItem = ({ control, index, fieldsLength, on ...@@ -50,6 +51,7 @@ const ContractVerificationFieldLibraryItem = ({ control, index, fieldsLength, on
{ ...field } { ...field }
isInvalid={ Boolean(error?.address) } isInvalid={ Boolean(error?.address) }
required required
autoComplete="off"
/> />
<InputPlaceholder text="Library address (0x...)" error={ error?.address }/> <InputPlaceholder text="Library address (0x...)" error={ error?.address }/>
</FormControl> </FormControl>
......
...@@ -27,6 +27,7 @@ const ContractVerificationFieldName = ({ hint }: Props) => { ...@@ -27,6 +27,7 @@ const ContractVerificationFieldName = ({ hint }: Props) => {
isInvalid={ Boolean(error) } isInvalid={ Boolean(error) }
maxLength={ 255 } maxLength={ 255 }
isDisabled={ formState.isSubmitting } isDisabled={ formState.isSubmitting }
autoComplete="off"
/> />
<InputPlaceholder text="Contract name" error={ error }/> <InputPlaceholder text="Contract name" error={ error }/>
</FormControl> </FormControl>
......
...@@ -35,6 +35,7 @@ const ContractVerificationFieldOptimization = () => { ...@@ -35,6 +35,7 @@ const ContractVerificationFieldOptimization = () => {
required required
maxLength={ 255 } maxLength={ 255 }
isDisabled={ formState.isSubmitting } isDisabled={ formState.isSubmitting }
autoComplete="off"
/> />
<InputPlaceholder text="Optimization runs"/> <InputPlaceholder text="Optimization runs"/>
</FormControl> </FormControl>
......
...@@ -21,6 +21,8 @@ interface Props { ...@@ -21,6 +21,8 @@ interface Props {
const ContractVerificationFieldSources = ({ accept, multiple, title, className, hint }: Props) => { const ContractVerificationFieldSources = ({ accept, multiple, title, className, hint }: Props) => {
const { setValue, getValues, control, formState } = useFormContext<FormFields>(); const { setValue, getValues, control, formState } = useFormContext<FormFields>();
const error = 'sources' in formState.errors ? formState.errors.sources : undefined;
const handleFileRemove = React.useCallback((index?: number) => { const handleFileRemove = React.useCallback((index?: number) => {
if (index === undefined) { if (index === undefined) {
return; return;
...@@ -57,8 +59,13 @@ const ContractVerificationFieldSources = ({ accept, multiple, title, className, ...@@ -57,8 +59,13 @@ const ContractVerificationFieldSources = ({ accept, multiple, title, className,
</Button> </Button>
</FileInput> </FileInput>
{ field.value && field.value.length > 0 && renderFiles(field.value) } { field.value && field.value.length > 0 && renderFiles(field.value) }
{ error && (
<Box fontSize="sm" mt={ 2 } color="error">
{ error.type === 'required' ? 'Field is required' : error.message }
</Box>
) }
</> </>
), [ accept, multiple, renderFiles ]); ), [ accept, error, multiple, renderFiles ]);
return ( return (
<> <>
......
...@@ -26,7 +26,7 @@ const ContractVerification = () => { ...@@ -26,7 +26,7 @@ const ContractVerification = () => {
<PageTitle <PageTitle
text="New smart contract verification" text="New smart contract verification"
backLinkUrl={ hasGoBackLink ? referrer : undefined } backLinkUrl={ hasGoBackLink ? referrer : undefined }
backLinkLabel="Back to address" backLinkLabel="Back to contract"
/> />
{ hash && ( { hash && (
<Address> <Address>
......
...@@ -99,7 +99,7 @@ const TxDetails = () => { ...@@ -99,7 +99,7 @@ const TxDetails = () => {
const executionFailedBadge = toAddress.is_contract && Boolean(data.status) && data.result !== 'success' ? ( const executionFailedBadge = toAddress.is_contract && Boolean(data.status) && data.result !== 'success' ? (
<Tooltip label="Error occurred during contract execution"> <Tooltip label="Error occurred during contract execution">
<chakra.span display="inline-flex" ml={ 2 } mr={ 1 }> <chakra.span display="inline-flex" ml={ 2 } mr={ 1 }>
<Icon as={ errorIcon } boxSize={ 4 } color="red.500" cursor="pointer"/> <Icon as={ errorIcon } boxSize={ 4 } color="error" cursor="pointer"/>
</chakra.span> </chakra.span>
</Tooltip> </Tooltip>
) : null; ) : null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment