diff --git a/ui/src/components/core/button/button.styles.ts b/ui/src/components/core/button/button.styles.ts index 389f869..44e2694 100644 --- a/ui/src/components/core/button/button.styles.ts +++ b/ui/src/components/core/button/button.styles.ts @@ -161,6 +161,7 @@ export const StyledButton = styled('button', { verticalAlign: 'middle', userSelect: 'none', fontWeight: '$normal', + width: 'auto', '&:disabled': { cursor: 'not-allowed', opacity: '0.4', diff --git a/ui/src/components/core/index.ts b/ui/src/components/core/index.ts index 4147c28..19da8f6 100644 --- a/ui/src/components/core/index.ts +++ b/ui/src/components/core/index.ts @@ -4,3 +4,5 @@ export * from './icon'; export * from './input'; export * from './avatar'; export * from './separator.styles'; +export * from './text'; +export * from './switch'; diff --git a/ui/src/components/core/switch/index.ts b/ui/src/components/core/switch/index.ts new file mode 100644 index 0000000..563735d --- /dev/null +++ b/ui/src/components/core/switch/index.ts @@ -0,0 +1 @@ +export * from './switch'; diff --git a/ui/src/components/core/switch/switch.tsx b/ui/src/components/core/switch/switch.tsx new file mode 100644 index 0000000..ed3c890 --- /dev/null +++ b/ui/src/components/core/switch/switch.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +import { Switch as SwitchComponent } from '@headlessui/react'; + +type SwitchProps = { + checked: boolean; + onChange: (checked: boolean) => void; +}; + +export const Switch: React.FC = ({ checked, onChange }) => ( + + + {checked ? 'Yes' : 'No'} + + +); diff --git a/ui/src/components/core/text/index.ts b/ui/src/components/core/text/index.ts new file mode 100644 index 0000000..61463f6 --- /dev/null +++ b/ui/src/components/core/text/index.ts @@ -0,0 +1 @@ +export * from './text.styles'; diff --git a/ui/src/components/core/text/text.styles.ts b/ui/src/components/core/text/text.styles.ts new file mode 100644 index 0000000..c5e24df --- /dev/null +++ b/ui/src/components/core/text/text.styles.ts @@ -0,0 +1,5 @@ +import { dripStitches } from '@/theme'; + +const { styled } = dripStitches; + +export const Text = styled('span'); diff --git a/ui/src/views/mint/form-step/fields/verify-nfa-field.tsx b/ui/src/views/mint/form-step/fields/verify-nfa-field.tsx deleted file mode 100644 index d5dea67..0000000 --- a/ui/src/views/mint/form-step/fields/verify-nfa-field.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { Card, Flex, Grid } from '@/components'; -import { Mint } from '@/views/mint/mint.context'; - -export const VerifyNFAField = () => { - const { verifyNFA, setVerifyNFA } = Mint.useContext(); - - const handleVerifyNFAChange = (e: React.ChangeEvent) => { - setVerifyNFA(e.target.checked); - }; - - return ( - - {/* TODO replace for grid */} - - - Verify NFA - - Add Fleek as a controller to be verified, learn more here. - - - - - - ); -}; diff --git a/ui/src/views/mint/mint-stepper.tsx b/ui/src/views/mint/mint-stepper.tsx index 40794ad..1196781 100644 --- a/ui/src/views/mint/mint-stepper.tsx +++ b/ui/src/views/mint/mint-stepper.tsx @@ -1,46 +1,38 @@ import { Stepper } from '@/components'; -import { FormStep } from './form-step'; import { MintPreview } from './preview-step/mint-preview'; import { GithubStep } from './github-step'; import { MintStep } from './mint-step'; import { WalletStep } from './wallet-step'; -import { Mint } from './mint.context'; -import { NftMinted } from './nft-minted'; +import { NFAStep } from './nfa-step'; export const MintStepper = () => { - const { sucessMint } = Mint.useContext(); + return ( + + + + + + + - if (!sucessMint) { - return ( - - - - - - - + + + + + - - - - - + + + + + - - - - - - - - - - - - - - ); - } - - return ; + + + + + + + + ); }; diff --git a/ui/src/views/mint/mint.context.tsx b/ui/src/views/mint/mint.context.tsx index 778a231..fc2894e 100644 --- a/ui/src/views/mint/mint.context.tsx +++ b/ui/src/views/mint/mint.context.tsx @@ -10,6 +10,7 @@ export type MintContext = { branchName: DropdownItem; //get value from DropdownItem to mint commitHash: string; githubStep: number; + nfaStep: number; appName: string; appDescription: string; appLogo: string; @@ -18,6 +19,7 @@ export type MintContext = { domain: string; verifyNFA: boolean; setGithubStep: (step: number) => void; + setNfaStep: (step: number) => void; setSelectedUserOrg: (userOrg: ComboboxItem) => void; setRepositoryName: (repo: GithubState.Repository) => void; setBranchName: (branch: DropdownItem) => void; @@ -55,6 +57,7 @@ export abstract class Mint { const [githubStep, setGithubStepContext] = useState(1); //NFA Details + const [nfaStep, setNfaStep] = useState(1); const [appName, setAppName] = useState(''); const [appDescription, setAppDescription] = useState(''); const [appLogo, setAppLogo] = useState(''); @@ -77,6 +80,7 @@ export abstract class Mint { branchName, commitHash, githubStep, + nfaStep, appName, appDescription, appLogo, @@ -86,6 +90,7 @@ export abstract class Mint { verifyNFA, setSelectedUserOrg, setGithubStep, + setNfaStep, setRepositoryName, setBranchName, setCommitHash, diff --git a/ui/src/views/mint/form-step/fields/app-description-field.tsx b/ui/src/views/mint/nfa-step/form-step/fields/app-description-field.tsx similarity index 89% rename from ui/src/views/mint/form-step/fields/app-description-field.tsx rename to ui/src/views/mint/nfa-step/form-step/fields/app-description-field.tsx index d441757..d268c21 100644 --- a/ui/src/views/mint/form-step/fields/app-description-field.tsx +++ b/ui/src/views/mint/nfa-step/form-step/fields/app-description-field.tsx @@ -1,5 +1,5 @@ import { Form } from '@/components'; -import { Mint } from '../../mint.context'; +import { Mint } from '../../../mint.context'; export const AppDescriptionField = () => { const { appDescription, setAppDescription } = Mint.useContext(); diff --git a/ui/src/views/mint/form-step/fields/app-name-field.tsx b/ui/src/views/mint/nfa-step/form-step/fields/app-name-field.tsx similarity index 87% rename from ui/src/views/mint/form-step/fields/app-name-field.tsx rename to ui/src/views/mint/nfa-step/form-step/fields/app-name-field.tsx index d6c3a5b..3f36959 100644 --- a/ui/src/views/mint/form-step/fields/app-name-field.tsx +++ b/ui/src/views/mint/nfa-step/form-step/fields/app-name-field.tsx @@ -1,5 +1,5 @@ import { Form } from '@/components'; -import { Mint } from '../../mint.context'; +import { Mint } from '../../../mint.context'; export const AppNameField = () => { const { appName, setAppName } = Mint.useContext(); diff --git a/ui/src/views/mint/form-step/fields/ens-domain-field/domain-field.tsx b/ui/src/views/mint/nfa-step/form-step/fields/ens-domain-field/domain-field.tsx similarity index 100% rename from ui/src/views/mint/form-step/fields/ens-domain-field/domain-field.tsx rename to ui/src/views/mint/nfa-step/form-step/fields/ens-domain-field/domain-field.tsx diff --git a/ui/src/views/mint/form-step/fields/ens-domain-field/ens-domain-field.tsx b/ui/src/views/mint/nfa-step/form-step/fields/ens-domain-field/ens-domain-field.tsx similarity index 100% rename from ui/src/views/mint/form-step/fields/ens-domain-field/ens-domain-field.tsx rename to ui/src/views/mint/nfa-step/form-step/fields/ens-domain-field/ens-domain-field.tsx diff --git a/ui/src/views/mint/form-step/fields/ens-domain-field/ens-field.tsx b/ui/src/views/mint/nfa-step/form-step/fields/ens-domain-field/ens-field.tsx similarity index 100% rename from ui/src/views/mint/form-step/fields/ens-domain-field/ens-field.tsx rename to ui/src/views/mint/nfa-step/form-step/fields/ens-domain-field/ens-field.tsx diff --git a/ui/src/views/mint/form-step/fields/ens-domain-field/index.ts b/ui/src/views/mint/nfa-step/form-step/fields/ens-domain-field/index.ts similarity index 100% rename from ui/src/views/mint/form-step/fields/ens-domain-field/index.ts rename to ui/src/views/mint/nfa-step/form-step/fields/ens-domain-field/index.ts diff --git a/ui/src/views/mint/form-step/fields/index.ts b/ui/src/views/mint/nfa-step/form-step/fields/index.ts similarity index 77% rename from ui/src/views/mint/form-step/fields/index.ts rename to ui/src/views/mint/nfa-step/form-step/fields/index.ts index abfeb6e..f806f33 100644 --- a/ui/src/views/mint/form-step/fields/index.ts +++ b/ui/src/views/mint/nfa-step/form-step/fields/index.ts @@ -2,4 +2,3 @@ export * from './logo-field'; export * from './app-name-field'; export * from './app-description-field'; export * from './ens-domain-field'; -export * from './verify-nfa-field'; diff --git a/ui/src/views/mint/form-step/fields/logo-field/color-picker.tsx b/ui/src/views/mint/nfa-step/form-step/fields/logo-field/color-picker.tsx similarity index 92% rename from ui/src/views/mint/form-step/fields/logo-field/color-picker.tsx rename to ui/src/views/mint/nfa-step/form-step/fields/logo-field/color-picker.tsx index 2d8b73b..ffac436 100644 --- a/ui/src/views/mint/form-step/fields/logo-field/color-picker.tsx +++ b/ui/src/views/mint/nfa-step/form-step/fields/logo-field/color-picker.tsx @@ -2,7 +2,7 @@ import { Card, Flex } from '@/components'; import { useRef } from 'react'; // @ts-ignore import ColorThief from 'colorthief'; -import { Mint } from '../../../mint.context'; +import { Mint } from '../../../../mint.context'; export const ColorPicker = () => { const { appLogo, logoColor, setLogoColor } = Mint.useContext(); diff --git a/ui/src/views/mint/form-step/fields/logo-field/index.ts b/ui/src/views/mint/nfa-step/form-step/fields/logo-field/index.ts similarity index 100% rename from ui/src/views/mint/form-step/fields/logo-field/index.ts rename to ui/src/views/mint/nfa-step/form-step/fields/logo-field/index.ts diff --git a/ui/src/views/mint/form-step/fields/logo-field/logo-field.tsx b/ui/src/views/mint/nfa-step/form-step/fields/logo-field/logo-field.tsx similarity index 93% rename from ui/src/views/mint/form-step/fields/logo-field/logo-field.tsx rename to ui/src/views/mint/nfa-step/form-step/fields/logo-field/logo-field.tsx index cb52cc0..1dc9ec2 100644 --- a/ui/src/views/mint/form-step/fields/logo-field/logo-field.tsx +++ b/ui/src/views/mint/nfa-step/form-step/fields/logo-field/logo-field.tsx @@ -1,6 +1,6 @@ import { Flex, Form } from '@/components'; import { useState } from 'react'; -import { Mint } from '../../../mint.context'; +import { Mint } from '../../../../mint.context'; import { fileToBase64, validateFileSize } from '../../form.utils'; import { ColorPicker } from './color-picker'; diff --git a/ui/src/views/mint/form-step/form.utils.ts b/ui/src/views/mint/nfa-step/form-step/form.utils.ts similarity index 100% rename from ui/src/views/mint/form-step/form.utils.ts rename to ui/src/views/mint/nfa-step/form-step/form.utils.ts diff --git a/ui/src/views/mint/form-step/index.tsx b/ui/src/views/mint/nfa-step/form-step/index.tsx similarity index 100% rename from ui/src/views/mint/form-step/index.tsx rename to ui/src/views/mint/nfa-step/form-step/index.tsx diff --git a/ui/src/views/mint/form-step/mint-form.tsx b/ui/src/views/mint/nfa-step/form-step/mint-form.tsx similarity index 80% rename from ui/src/views/mint/form-step/mint-form.tsx rename to ui/src/views/mint/nfa-step/form-step/mint-form.tsx index 176adab..08ba63b 100644 --- a/ui/src/views/mint/form-step/mint-form.tsx +++ b/ui/src/views/mint/nfa-step/form-step/mint-form.tsx @@ -1,19 +1,18 @@ import { Button, Card, Grid, Stepper } from '@/components'; -import { Mint } from '../mint.context'; +import { Mint } from '../../mint.context'; import { LogoField, AppDescriptionField, AppNameField, EnsDomainField, - VerifyNFAField, } from './fields'; -import { MintCardHeader } from '../mint-card'; +import { MintCardHeader } from '../../mint-card'; import { useAccount } from 'wagmi'; import { parseColorToNumber } from './form.utils'; -export const FormStep = () => { +export const MintFormStep = () => { const { address } = useAccount(); - const { prevStep, nextStep } = Stepper.useContext(); + const { nextStep } = Stepper.useContext(); const { appName, appDescription, @@ -25,6 +24,7 @@ export const FormStep = () => { logoColor, repositoryName, verifyNFA, + setNfaStep, } = Mint.useContext(); const { setArgs } = Mint.useTransactionContext(); @@ -48,9 +48,13 @@ export const FormStep = () => { nextStep(); }; + const handlePrevStep = () => { + setNfaStep(1); + }; + return ( - + { - + + + + ); +}; diff --git a/ui/tailwind.config.js b/ui/tailwind.config.js index 904edc7..0e6b121 100644 --- a/ui/tailwind.config.js +++ b/ui/tailwind.config.js @@ -10,10 +10,17 @@ module.exports = { slate7: 'rgba(58, 63, 66, 1)', slate11: 'rgba(155, 161, 166, 1)', slate12: 'rgba(236, 237, 238, 1)', + green4: 'rgba(17, 49, 35, 1)', + green11: 'rgba(76, 195, 138, 1)', + red4: 'rgba(72, 26, 29, 1)', + red11: 'rgba(255, 99, 105, 1)', }, borderRadius: { xhl: '1.25rem', }, + space: { + '1h': '0.375rem', + }, }, }, plugins: [],