Commit 6e965de6 authored by tom's avatar tom

fixes

parent 860e688e
......@@ -15,6 +15,10 @@ const semanticTokens = {
link_hovered: {
'default': 'blue.400',
},
error: {
'default': 'red.400',
_dark: 'red.300',
},
},
};
......
......@@ -85,7 +85,7 @@ const ContractWriteResultDumb = ({ result, onSettle, txInfo }: Props) => {
alignItems="center"
whiteSpace="pre-wrap"
wordBreak="break-all"
color={ txInfo.status === 'error' || isErrorResult ? 'red.600' : undefined }
color={ txInfo.status === 'error' || isErrorResult ? 'error' : undefined }
>
{ content }
</Box>
......
......@@ -59,7 +59,6 @@ const ContractVerificationForm = () => {
size="lg"
type="submit"
mt={ 12 }
isDisabled={ !formState.isValid || !formState.isDirty }
isLoading={ formState.isSubmitting }
loadingText="Verify & publish"
>
......
......@@ -37,6 +37,7 @@ const ContractVerificationFieldLibraryItem = ({ control, index, fieldsLength, on
required
isInvalid={ Boolean(error?.name) }
maxLength={ 255 }
autoComplete="off"
/>
<InputPlaceholder text="Library name (.sol file)" error={ error?.name }/>
</FormControl>
......@@ -50,6 +51,7 @@ const ContractVerificationFieldLibraryItem = ({ control, index, fieldsLength, on
{ ...field }
isInvalid={ Boolean(error?.address) }
required
autoComplete="off"
/>
<InputPlaceholder text="Library address (0x...)" error={ error?.address }/>
</FormControl>
......
......@@ -27,6 +27,7 @@ const ContractVerificationFieldName = ({ hint }: Props) => {
isInvalid={ Boolean(error) }
maxLength={ 255 }
isDisabled={ formState.isSubmitting }
autoComplete="off"
/>
<InputPlaceholder text="Contract name" error={ error }/>
</FormControl>
......
......@@ -35,6 +35,7 @@ const ContractVerificationFieldOptimization = () => {
required
maxLength={ 255 }
isDisabled={ formState.isSubmitting }
autoComplete="off"
/>
<InputPlaceholder text="Optimization runs"/>
</FormControl>
......
......@@ -21,6 +21,8 @@ interface Props {
const ContractVerificationFieldSources = ({ accept, multiple, title, className, hint }: Props) => {
const { setValue, getValues, control, formState } = useFormContext<FormFields>();
const error = 'sources' in formState.errors ? formState.errors.sources : undefined;
const handleFileRemove = React.useCallback((index?: number) => {
if (index === undefined) {
return;
......@@ -57,8 +59,13 @@ const ContractVerificationFieldSources = ({ accept, multiple, title, className,
</Button>
</FileInput>
{ 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 (
<>
......
......@@ -26,7 +26,7 @@ const ContractVerification = () => {
<PageTitle
text="New smart contract verification"
backLinkUrl={ hasGoBackLink ? referrer : undefined }
backLinkLabel="Back to address"
backLinkLabel="Back to contract"
/>
{ hash && (
<Address>
......
......@@ -99,7 +99,7 @@ const TxDetails = () => {
const executionFailedBadge = toAddress.is_contract && Boolean(data.status) && data.result !== 'success' ? (
<Tooltip label="Error occurred during contract execution">
<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>
</Tooltip>
) : 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