Files
js/components/batch-upload/UploadStep.tsx
T
2eda4d3022 Custom Contract (working branch) (#35)
* initial /publish

* custom contract init (#27)

* clean up customContract interface for the moment

* upgrade sdk & make multi-uri publish work

* upgraded dependencies and customContract workflow

* more custom contract stuff

* publish ui update

* basic publish & deploy flow works

* cleanup eslint

* update sdk

* add contract address to toast and log it out

* integrate newer sdk version

* upgrade deps

* full deploy loop functional with updated sdk

* upgrade sdk

* upgrade deps

* upgrade sdk to fix big contracts

* full flow!

* update deps

* update to latest sdk, support custom contracts in contracts list

* one more sdk update

* cache keys // analytics mapping

* make mr. typescript happy

* try catch the resolve type (need to fix it in SDK)

* fix type check

* upgrade sdk & handle `ipfs=` from cli

* fix yarn lock

* publishBatch

* add very basic code tab

* fix build

* init cleaning up code tab

* fix zindex issue

* update code segments

* prep some more stuff

* remove duplication

* this wont build and that is ok

* fix build

* upgrade react package

* add super basic mint button

* update sdk

* clean up some custom contract interfaces a bit

* updated sdks all around

* change minting to useNFTMint

* append contract.functions to signatures so you can copy paste

* add byoc page tracking

* new publish page

* slightly fix hook

* custom deploy form update

* completely overhauled deploy flow now

* some improvements, empty states etc

* only show coming soon on non-mumbai

* tw-components

* fix contract items table

* upgrade deps

* fix secondary cta

* fix string

* fixed things more

* fix up code-block

* small code tab improvements

* Add mint drawer if ERC721 (#95)

* Update thumbnail/title/desc

* Add custom nft mint

* Fix FormHelperText

* Delete unused imports

* Remove imports

* fix build issues etc

* Add token drop (#93)

* Update thumbnail/title/desc

* Merge

* wip

* Token drop page working

* Add claim phases tab, add TokenDrop to conditionals

* update font size

* NFTs/token conditional

* Add QuantityInputWithUnlimited

* Update SDK

* Fix unlimited

* Remove fontSize

Co-authored-by: Jonas Daniels <[email protected]>

* set tokendrop back to coming soon

* remove "@dev" tag for sdk installation

* fix mappings file

* fix indentation on custom code tab

* ship central 🚢

* fix build

Co-authored-by: Joaquim Verges <[email protected]>
Co-authored-by: Jake Loo <[email protected]>
Co-authored-by: Nacho Iacovino <[email protected]>
2022-04-28 17:51:20 -07:00

130 lines
4.5 KiB
TypeScript

import {
AspectRatio,
Center,
Code,
Container,
Flex,
Icon,
Link,
ListItem,
UnorderedList,
VStack,
} from "@chakra-ui/react";
import { BsFillCloudUploadFill } from "react-icons/bs";
import { Heading, Text } from "tw-components";
interface UploadStepProps {
getRootProps: any;
getInputProps: any;
noFile: boolean;
isDragActive: boolean;
}
export const UploadStep: React.FC<UploadStepProps> = ({
getRootProps,
noFile,
isDragActive,
getInputProps,
}) => {
return (
<Flex flexGrow={1} align="center" overflow="auto">
<Container maxW="container.page">
<Flex gap={8} flexDir={{ base: "column", md: "row" }}>
<AspectRatio w={{ base: "100%", md: "50%" }}>
<Center
borderRadius="md"
{...getRootProps()}
cursor="pointer"
bg={noFile ? "red.200" : "inputBg"}
_hover={{
bg: "inputBgHover",
borderColor: "blue.500",
}}
borderColor="inputBorder"
borderWidth="1px"
>
<input {...getInputProps()} />
<VStack p={6}>
<Icon
as={BsFillCloudUploadFill}
boxSize={8}
mb={2}
color="gray.600"
/>
{isDragActive ? (
<Heading as={Text} size="label.md" color="gray.600">
Drop the files here
</Heading>
) : (
<Heading as={Text} size="label.md" color="gray.600">
{noFile
? "No CSV or valid JSON file found, please try again"
: "Drag & Drop files or folders here, or click to select files"}
</Heading>
)}
</VStack>
</Center>
</AspectRatio>
<Flex gap={2} flexDir="column" w={{ base: "100%", md: "50%" }}>
<Heading size="subtitle.sm">Requirements</Heading>
<UnorderedList>
<ListItem>
Files <em>must</em> contain one .csv or .json file with
metadata. -{" "}
<Link download color="blue.500" href="/example.csv">
Download example.csv
</Link>
.{" "}
<Link download color="blue.500" href="/example.json">
Download example.json
</Link>
.
</ListItem>
<ListItem>
The csv <em>must</em> have a <Code>name</Code> column, which
defines the name of the NFT.
</ListItem>
<ListItem>
Asset names <em>must</em> be sequential 0,1,2,3...n.[extension].
It doesn&apos;t matter at what number you begin. (Example:{" "}
<Code>131.png</Code>, <Code>132.png</Code>).
</ListItem>
</UnorderedList>
<Heading size="subtitle.sm" mt={4}>
Options
</Heading>
<UnorderedList>
<ListItem>
Images and other file types can be used in combination.
<br />
<small>
They both have to follow the asset naming convention above.
(Example: <Code>0.png</Code> and <Code>0.mp4</Code>,{" "}
<Code>1.png</Code> and <Code>1.glb</Code>, etc.)
</small>
</ListItem>
<ListItem>
When uploading files, we will upload them and pin them to IPFS
automatically for you. If you already have the files uploaded,
you can add an <Code>image</Code> and/or{" "}
<Code>animation_url</Code> column and add the IPFS hashes there.{" "}
<Link download color="blue.500" href="/example-with-ipfs.csv">
Download example.csv
</Link>
</ListItem>
<ListItem>
If you want to make your media files map to your NFTs, you can
add add the name of your files to the <Code>image</Code> and{" "}
<Code>animation_url</Code> column.{" "}
<Link download color="blue.500" href="/example-with-maps.csv">
Download example.csv
</Link>
</ListItem>
</UnorderedList>
</Flex>
</Flex>
</Container>
</Flex>
);
};