Files
explore/ui/contractVerification/methods/ContractVerificationStylusGitHubRepo.tsx
tom goriunovandGitHub f6725649da UI toolkit package (#2691)
* first version of the pack

* single entry point

* add custom components to the package

* move form components to toolkit

* add more utils and hooks to the package

* minor fixes

* add CI workflow

* update readme and package.json

* fix ts

* fix build of env-validator

* fix docker build

* fix icons size

* test fixes

* more test fixes
2025-04-21 19:44:22 +02:00

38 lines
1.7 KiB
TypeScript

import React from 'react';
import type { FormFields } from '../types';
import type { SmartContractVerificationConfig } from 'types/client/contract';
import { FormFieldText } from 'toolkit/components/forms/fields/FormFieldText';
import ContractVerificationFormRow from '../ContractVerificationFormRow';
import ContractVerificationMethod from '../ContractVerificationMethod';
import ContractVerificationFieldCommit from '../fields/ContractVerificationFieldCommit';
import ContractVerificationFieldCompiler from '../fields/ContractVerificationFieldCompiler';
import ContractVerificationFieldGitHubRepo from '../fields/ContractVerificationFieldGitHubRepo';
const ContractVerificationStylusGitHubRepo = ({ config }: { config: SmartContractVerificationConfig }) => {
const [ latestCommitHash, setLatestCommitHash ] = React.useState<string | undefined>(undefined);
return (
<ContractVerificationMethod title="Contract verification via Stylus (GitHub repository) ">
<ContractVerificationFieldCompiler config={ config } isStylus/>
<ContractVerificationFieldGitHubRepo onCommitHashChange={ setLatestCommitHash }/>
<ContractVerificationFieldCommit latestCommitHash={ latestCommitHash }/>
<ContractVerificationFormRow>
<FormFieldText<FormFields>
name="path_prefix"
placeholder="Path prefix"
/>
<span>
The crate should be located in the root directory. If it is not the case, please specify the relative path from
the root to the crate directory.
</span>
</ContractVerificationFormRow>
</ContractVerificationMethod>
);
};
export default React.memo(ContractVerificationStylusGitHubRepo);