-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Search section (homepage) Dark/Dim themes
Fixes #1373
- Loading branch information
Showing
55 changed files
with
399 additions
and
164 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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,19 @@ | ||
import type { NextPage } from 'next'; | ||
import React from 'react'; | ||
|
||
import type { Props } from 'nextjs/getServerSideProps'; | ||
import PageNextJs from 'nextjs/PageNextJs'; | ||
|
||
import ContractVerification from 'ui/pages/ContractVerification'; | ||
|
||
const Page: NextPage<Props> = (props: Props) => { | ||
return ( | ||
<PageNextJs pathname="/contract-verification" query={ props }> | ||
<ContractVerification/> | ||
</PageNextJs> | ||
); | ||
}; | ||
|
||
export default Page; | ||
|
||
export { base as getServerSideProps } from 'nextjs/getServerSideProps'; |
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,21 @@ | ||
#!/bin/bash | ||
|
||
# download assets for the running instance | ||
dotenv \ | ||
-e .env.development.local \ | ||
-e .env.local \ | ||
-e .env.development \ | ||
-e .env \ | ||
-- bash -c './deploy/scripts/download_assets.sh ./public/assets' | ||
|
||
# generate envs.js file and run the app | ||
dotenv \ | ||
-v NEXT_PUBLIC_GIT_COMMIT_SHA=$(git rev-parse --short HEAD) \ | ||
-v NEXT_PUBLIC_GIT_TAG=$(git describe --tags --abbrev=0) \ | ||
-e .env.secrets \ | ||
-e .env.development.local \ | ||
-e .env.local \ | ||
-e .env.development \ | ||
-e .env \ | ||
-- bash -c './deploy/scripts/make_envs_script.sh && next dev -- -p $NEXT_PUBLIC_APP_PORT' | | ||
pino-pretty |
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
Binary file modified
BIN
-21 Bytes
(100%)
...erificationForm.pw.tsx_mobile_flatten-source-code-method-dark-mode-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions
57
ui/contractVerification/fields/ContractVerificationFieldAddress.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,57 @@ | ||
import { FormControl, Input, chakra } from '@chakra-ui/react'; | ||
import React from 'react'; | ||
import type { ControllerRenderProps } from 'react-hook-form'; | ||
import { Controller, useFormContext } from 'react-hook-form'; | ||
|
||
import type { FormFields } from '../types'; | ||
|
||
import { ADDRESS_REGEXP, ADDRESS_LENGTH } from 'lib/validations/address'; | ||
import InputPlaceholder from 'ui/shared/InputPlaceholder'; | ||
|
||
import ContractVerificationFormRow from '../ContractVerificationFormRow'; | ||
|
||
interface Props { | ||
isReadOnly?: boolean; | ||
} | ||
|
||
const ContractVerificationFieldAddress = ({ isReadOnly }: Props) => { | ||
const { formState, control } = useFormContext<FormFields>(); | ||
|
||
const renderControl = React.useCallback(({ field }: {field: ControllerRenderProps<FormFields, 'address'>}) => { | ||
const error = 'address' in formState.errors ? formState.errors.address : undefined; | ||
|
||
return ( | ||
<FormControl variant="floating" id={ field.name } isRequired size={{ base: 'md', lg: 'lg' }}> | ||
<Input | ||
{ ...field } | ||
required | ||
isInvalid={ Boolean(error) } | ||
maxLength={ ADDRESS_LENGTH } | ||
isDisabled={ formState.isSubmitting || isReadOnly } | ||
autoComplete="off" | ||
/> | ||
<InputPlaceholder text="Smart contract / Address (0x...)" error={ error }/> | ||
</FormControl> | ||
); | ||
}, [ formState.errors, formState.isSubmitting, isReadOnly ]); | ||
|
||
return ( | ||
<> | ||
<ContractVerificationFormRow> | ||
<chakra.span fontWeight={ 500 } fontSize="lg" fontFamily="heading"> | ||
Contract address to verify | ||
</chakra.span> | ||
</ContractVerificationFormRow> | ||
<ContractVerificationFormRow mb={ 3 }> | ||
<Controller | ||
name="address" | ||
control={ control } | ||
render={ renderControl } | ||
rules={{ required: true, pattern: ADDRESS_REGEXP }} | ||
/> | ||
</ContractVerificationFormRow> | ||
</> | ||
); | ||
}; | ||
|
||
export default React.memo(ContractVerificationFieldAddress); |
Oops, something went wrong.