Update contract dashboard landing page
This commit is contained in:
parent
2edbea9245
commit
eab5a4a36c
@ -92,6 +92,7 @@ export const UploadDetails = ({ onChange, minterType, minterAcquisitionMethod }:
|
||||
setAssetFilesArray([])
|
||||
setMetadataFilesArray([])
|
||||
if (event.target.files === null) return
|
||||
if (minterType === 'vending') {
|
||||
//sort the files
|
||||
const sortedFiles = Array.from(event.target.files).sort((a, b) => naturalCompare(a.name, b.name))
|
||||
//check if the sorted file names are in numerical order
|
||||
@ -104,6 +105,7 @@ export const UploadDetails = ({ onChange, minterType, minterAcquisitionMethod }:
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
let loadedFileCount = 0
|
||||
const files: File[] = []
|
||||
let reader: FileReader
|
||||
@ -133,6 +135,7 @@ export const UploadDetails = ({ onChange, minterType, minterAcquisitionMethod }:
|
||||
event.target.value = ''
|
||||
return toast.error('The number of metadata files should be equal to the number of asset files.')
|
||||
}
|
||||
if (minterType === 'vending') {
|
||||
//sort the files
|
||||
const sortedFiles = Array.from(event.target.files).sort((a, b) => naturalCompare(a.name, b.name))
|
||||
//check if the sorted file names are in numerical order
|
||||
@ -145,6 +148,7 @@ export const UploadDetails = ({ onChange, minterType, minterAcquisitionMethod }:
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
let loadedFileCount = 0
|
||||
const files: File[] = []
|
||||
let reader: FileReader
|
||||
|
@ -276,7 +276,8 @@ const CollectionCreationPage: NextPage = () => {
|
||||
setBaseTokenUri(baseUri)
|
||||
const result = await baseMinterContract
|
||||
.use(minterDetails?.existingMinter as string)
|
||||
?.mint(wallet.address, `ipfs://${baseUri}`)
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
?.mint(wallet.address, `ipfs://${baseUri}/${uploadDetails?.metadataFiles[0].name.split('.')[0]}`)
|
||||
console.log(result)
|
||||
return result
|
||||
})
|
||||
@ -521,7 +522,8 @@ const CollectionCreationPage: NextPage = () => {
|
||||
if (uploadDetails.uploadMethod === 'new' && uploadDetails.metadataFiles.length === 0) {
|
||||
throw new Error('Please select the metadata files')
|
||||
}
|
||||
if (uploadDetails.uploadMethod === 'new') compareFileArrays(uploadDetails.assetFiles, uploadDetails.metadataFiles)
|
||||
if (uploadDetails.uploadMethod === 'new' && minterType === 'vending')
|
||||
compareFileArrays(uploadDetails.assetFiles, uploadDetails.metadataFiles)
|
||||
if (uploadDetails.uploadMethod === 'new') {
|
||||
if (uploadDetails.uploadService === 'nft-storage') {
|
||||
if (uploadDetails.nftStorageApiKey === '') {
|
||||
|
@ -20,8 +20,19 @@ const HomePage: NextPage = () => {
|
||||
<br />
|
||||
|
||||
<div className="grid gap-8 md:grid-cols-2">
|
||||
<HomeCard className="p-4 -m-4 hover:bg-gray-500/10 rounded" link="/contracts/minter" title="Minter contract">
|
||||
Execute messages and run queries on Stargaze's minter contract.
|
||||
<HomeCard
|
||||
className="p-4 -m-4 hover:bg-gray-500/10 rounded"
|
||||
link="/contracts/baseMinter"
|
||||
title="Base Minter contract"
|
||||
>
|
||||
Execute messages and run queries on Stargaze's Base Minter contract.
|
||||
</HomeCard>
|
||||
<HomeCard
|
||||
className="p-4 -m-4 hover:bg-gray-500/10 rounded"
|
||||
link="/contracts/vendingMinter"
|
||||
title="Vending Minter contract"
|
||||
>
|
||||
Execute messages and run queries on Stargaze's Vending Minter contract.
|
||||
</HomeCard>
|
||||
<HomeCard className="p-4 -m-4 hover:bg-gray-500/10 rounded" link="/contracts/sg721" title="Sg721 Contract">
|
||||
Execute messages and run queries on Stargaze's sg721 contract.
|
||||
|
Loading…
Reference in New Issue
Block a user