feat: add ipfs hash in mint form (#267)
* feat: add ipfs hash in mint form * chore: remove harcoded verifier from mint form
This commit is contained in:
parent
bbe73f4d73
commit
bab42a5e6e
File diff suppressed because one or more lines are too long
|
|
@ -179,6 +179,7 @@ export namespace ArgumentsMaps {
|
||||||
string, // string ENS
|
string, // string ENS
|
||||||
string, // string commitHash
|
string, // string commitHash
|
||||||
string, // string gitRepository
|
string, // string gitRepository
|
||||||
|
string, // string ipfsHash
|
||||||
string, // string logo
|
string, // string logo
|
||||||
number, // uint24 color
|
number, // uint24 color
|
||||||
boolean, // bool accessPointAutoApproval
|
boolean, // bool accessPointAutoApproval
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ export const FleekERC721 = {
|
||||||
params.description.replaceAll(/\n/g, '\\n'), //replace break lines with \\n so it doesn't break the json,
|
params.description.replaceAll(/\n/g, '\\n'), //replace break lines with \\n so it doesn't break the json,
|
||||||
params.image,
|
params.image,
|
||||||
params.externalUrl,
|
params.externalUrl,
|
||||||
|
params.ipfsHash,
|
||||||
params.ens,
|
params.ens,
|
||||||
params.commitHash,
|
params.commitHash,
|
||||||
params.repo
|
params.repo
|
||||||
|
|
@ -155,6 +156,7 @@ export namespace FleekERC721 {
|
||||||
description: string;
|
description: string;
|
||||||
owner: string;
|
owner: string;
|
||||||
externalUrl: string;
|
externalUrl: string;
|
||||||
|
ipfsHash: string;
|
||||||
image: string;
|
image: string;
|
||||||
ens?: string;
|
ens?: string;
|
||||||
commitHash: string;
|
commitHash: string;
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@ import {
|
||||||
getDefaultClient,
|
getDefaultClient,
|
||||||
} from 'connectkit';
|
} from 'connectkit';
|
||||||
import { createClient, WagmiConfig } from 'wagmi';
|
import { createClient, WagmiConfig } from 'wagmi';
|
||||||
import { goerli } from 'wagmi/chains';
|
import { goerli, polygonMumbai } from 'wagmi/chains';
|
||||||
|
|
||||||
import { env } from '@/constants';
|
import { env } from '@/constants';
|
||||||
|
|
||||||
const alchemyId = env.alchemy.id;
|
const alchemyId = env.alchemy.id;
|
||||||
const chains = [goerli];
|
const chains = [polygonMumbai];
|
||||||
|
|
||||||
const wagmiClient = createClient(
|
const wagmiClient = createClient(
|
||||||
getDefaultClient({
|
getDefaultClient({
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ const ItemsDropdown: ItemDropdown[] = [
|
||||||
|
|
||||||
export const ComboboxTest: React.FC = () => {
|
export const ComboboxTest: React.FC = () => {
|
||||||
const selected = useState<Item>();
|
const selected = useState<Item>();
|
||||||
const selectedDropdown = useState<ItemDropdown>(ItemsDropdown[0]);
|
const selectedDropdown = useState<ItemDropdown>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,4 @@ export * from './logo-field';
|
||||||
export * from './app-name-field';
|
export * from './app-name-field';
|
||||||
export * from './app-description-field';
|
export * from './app-description-field';
|
||||||
export * from './ens-domain-field';
|
export * from './ens-domain-field';
|
||||||
|
export * from './ipfs-hash-field';
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { Form } from '@/components';
|
||||||
|
|
||||||
|
import { useMintFormContext } from '../mint-form.context';
|
||||||
|
|
||||||
|
export const IPFSHashField: React.FC = () => {
|
||||||
|
const {
|
||||||
|
form: { ipfsHash },
|
||||||
|
} = useMintFormContext();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Form.Field context={ipfsHash}>
|
||||||
|
<Form.Label>IPFS Hash</Form.Label>
|
||||||
|
<Form.Input placeholder="Your IPFS hash" />
|
||||||
|
<Form.Overline />
|
||||||
|
</Form.Field>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
@ -13,6 +13,7 @@ export type MintFormContext = {
|
||||||
logoColor: FormField;
|
logoColor: FormField;
|
||||||
ens: FormField;
|
ens: FormField;
|
||||||
domainURL: FormField;
|
domainURL: FormField;
|
||||||
|
ipfsHash: FormField;
|
||||||
verifier: FormField;
|
verifier: FormField;
|
||||||
isValid: ReactState<boolean>;
|
isValid: ReactState<boolean>;
|
||||||
};
|
};
|
||||||
|
|
@ -51,6 +52,7 @@ export const useMintFormContextInit = (): MintFormContext => ({
|
||||||
StringValidators.required,
|
StringValidators.required,
|
||||||
StringValidators.isUrl,
|
StringValidators.isUrl,
|
||||||
]),
|
]),
|
||||||
|
ipfsHash: useFormField('ipfsHash', [StringValidators.required]),
|
||||||
ens: useFormField('ens', [], ''),
|
ens: useFormField('ens', [], ''),
|
||||||
verifier: useFormField('verifier', [StringValidators.required]),
|
verifier: useFormField('verifier', [StringValidators.required]),
|
||||||
isValid: useState(false),
|
isValid: useState(false),
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import {
|
||||||
AppDescriptionField,
|
AppDescriptionField,
|
||||||
AppNameField,
|
AppNameField,
|
||||||
EnsDomainField,
|
EnsDomainField,
|
||||||
|
IPFSHashField,
|
||||||
LogoField,
|
LogoField,
|
||||||
} from './fields';
|
} from './fields';
|
||||||
import { useMintFormContext } from './mint-form.context';
|
import { useMintFormContext } from './mint-form.context';
|
||||||
|
|
@ -38,12 +39,18 @@ export const MintFormStep: React.FC = () => {
|
||||||
domainURL: {
|
domainURL: {
|
||||||
value: [domainURL],
|
value: [domainURL],
|
||||||
},
|
},
|
||||||
|
ipfsHash: {
|
||||||
|
value: [ipfsHash],
|
||||||
|
},
|
||||||
gitCommit: {
|
gitCommit: {
|
||||||
value: [gitCommit],
|
value: [gitCommit],
|
||||||
},
|
},
|
||||||
gitBranch: {
|
gitBranch: {
|
||||||
value: [gitBranch],
|
value: [gitBranch],
|
||||||
},
|
},
|
||||||
|
verifier: {
|
||||||
|
value: [verifier],
|
||||||
|
},
|
||||||
logoColor: {
|
logoColor: {
|
||||||
value: [logoColor],
|
value: [logoColor],
|
||||||
},
|
},
|
||||||
|
|
@ -69,10 +76,11 @@ export const MintFormStep: React.FC = () => {
|
||||||
ens,
|
ens,
|
||||||
gitCommit,
|
gitCommit,
|
||||||
`${repositoryName?.url}/tree/${gitBranch}`,
|
`${repositoryName?.url}/tree/${gitBranch}`,
|
||||||
|
ipfsHash,
|
||||||
appLogo,
|
appLogo,
|
||||||
parseColorToNumber(logoColor),
|
parseColorToNumber(logoColor),
|
||||||
verifyNFA,
|
verifyNFA,
|
||||||
'0xdBb04e00D5ec8C9e3aeF811D315Ee7C147c5DBFD', //TODO remove hardcode
|
verifier,
|
||||||
{ value: billing },
|
{ value: billing },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -99,6 +107,7 @@ export const MintFormStep: React.FC = () => {
|
||||||
<Flex css={{ gap: '$4', flexDirection: 'column' }}>
|
<Flex css={{ gap: '$4', flexDirection: 'column' }}>
|
||||||
<AppNameField />
|
<AppNameField />
|
||||||
<AppDescriptionField />
|
<AppDescriptionField />
|
||||||
|
<IPFSHashField />
|
||||||
<EnsDomainField />
|
<EnsDomainField />
|
||||||
<LogoField />
|
<LogoField />
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import { useMintFormContext } from '../form-step';
|
||||||
|
|
||||||
// TODO: remove mocked items after graphql api is fixed
|
// TODO: remove mocked items after graphql api is fixed
|
||||||
const mockedItems = [
|
const mockedItems = [
|
||||||
|
'0xd4997d0facc83231b9f26a8b2155b4869e99946f',
|
||||||
'0xdBb04e00D5ec8C9e3aeF811D315Ee7C147c5DBFD',
|
'0xdBb04e00D5ec8C9e3aeF811D315Ee7C147c5DBFD',
|
||||||
'0x7ED735b7095C05d78dF169F991f2b7f1A1F1A049',
|
'0x7ED735b7095C05d78dF169F991f2b7f1A1F1A049',
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue