Dictate minting start time wrt whitelist start time
This commit is contained in:
parent
d28af744a5
commit
ae2b565af6
@ -23,6 +23,8 @@ interface MintingDetailsProps {
|
|||||||
minimumMintPrice: number
|
minimumMintPrice: number
|
||||||
mintingTokenFromFactory?: TokenInfo
|
mintingTokenFromFactory?: TokenInfo
|
||||||
importedMintingDetails?: MintingDetailsDataProps
|
importedMintingDetails?: MintingDetailsDataProps
|
||||||
|
isPresale: boolean
|
||||||
|
whitelistStartDate?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MintingDetailsDataProps {
|
export interface MintingDetailsDataProps {
|
||||||
@ -41,6 +43,8 @@ export const MintingDetails = ({
|
|||||||
minimumMintPrice,
|
minimumMintPrice,
|
||||||
mintingTokenFromFactory,
|
mintingTokenFromFactory,
|
||||||
importedMintingDetails,
|
importedMintingDetails,
|
||||||
|
isPresale,
|
||||||
|
whitelistStartDate,
|
||||||
}: MintingDetailsProps) => {
|
}: MintingDetailsProps) => {
|
||||||
const wallet = useWallet()
|
const wallet = useWallet()
|
||||||
const { timezone } = useGlobalSettings()
|
const { timezone } = useGlobalSettings()
|
||||||
@ -130,6 +134,12 @@ export const MintingDetails = ({
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [importedMintingDetails])
|
}, [importedMintingDetails])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isPresale) {
|
||||||
|
setTimestamp(whitelistStartDate ? new Date(Number(whitelistStartDate) / 1_000_000) : undefined)
|
||||||
|
}
|
||||||
|
}, [whitelistStartDate, isPresale])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<FormGroup subtitle="Information about your minting settings" title="Minting Details">
|
<FormGroup subtitle="Information about your minting settings" title="Minting Details">
|
||||||
@ -163,10 +173,13 @@ export const MintingDetails = ({
|
|||||||
<FormControl
|
<FormControl
|
||||||
htmlId="timestamp"
|
htmlId="timestamp"
|
||||||
isRequired
|
isRequired
|
||||||
subtitle={`Minting start time ${timezone === 'Local' ? '(local)' : '(UTC)'}`}
|
subtitle={`Minting start time ${isPresale ? '(is dictated by whitelist start time)' : ''} ${
|
||||||
|
timezone === 'Local' ? '(local)' : '(UTC)'
|
||||||
|
}`}
|
||||||
title="Start Time"
|
title="Start Time"
|
||||||
>
|
>
|
||||||
<InputDateTime
|
<InputDateTime
|
||||||
|
disabled={isPresale}
|
||||||
minDate={
|
minDate={
|
||||||
timezone === 'Local' ? new Date() : new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000)
|
timezone === 'Local' ? new Date() : new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000)
|
||||||
}
|
}
|
||||||
|
@ -332,7 +332,7 @@ export const WhitelistDetails = ({
|
|||||||
htmlId="start-date"
|
htmlId="start-date"
|
||||||
isRequired
|
isRequired
|
||||||
subtitle="Start time for minting tokens to whitelisted addresses"
|
subtitle="Start time for minting tokens to whitelisted addresses"
|
||||||
title={`Start Time ${timezone === 'Local' ? '(local)' : '(UTC)'}`}
|
title={`Whitelist Start Time ${timezone === 'Local' ? '(local)' : '(UTC)'}`}
|
||||||
>
|
>
|
||||||
<InputDateTime
|
<InputDateTime
|
||||||
minDate={
|
minDate={
|
||||||
@ -359,8 +359,8 @@ export const WhitelistDetails = ({
|
|||||||
<FormControl
|
<FormControl
|
||||||
htmlId="end-date"
|
htmlId="end-date"
|
||||||
isRequired
|
isRequired
|
||||||
subtitle="End time for minting tokens to whitelisted addresses"
|
subtitle="Whitelist End Time dictates when public sales will start"
|
||||||
title={`End Time ${timezone === 'Local' ? '(local)' : '(UTC)'}`}
|
title={`Whitelist End Time ${timezone === 'Local' ? '(local)' : '(UTC)'}`}
|
||||||
>
|
>
|
||||||
<InputDateTime
|
<InputDateTime
|
||||||
minDate={
|
minDate={
|
||||||
|
@ -1908,6 +1908,7 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
<Conditional test={minterType === 'vending'}>
|
<Conditional test={minterType === 'vending'}>
|
||||||
<MintingDetails
|
<MintingDetails
|
||||||
importedMintingDetails={importedDetails?.mintingDetails}
|
importedMintingDetails={importedDetails?.mintingDetails}
|
||||||
|
isPresale={whitelistDetails?.whitelistState === 'new'}
|
||||||
minimumMintPrice={
|
minimumMintPrice={
|
||||||
whitelistDetails?.whitelistState !== 'none' && whitelistDetails?.whitelistType === 'flex'
|
whitelistDetails?.whitelistState !== 'none' && whitelistDetails?.whitelistType === 'flex'
|
||||||
? Number(minimumFlexMintPrice) / 1000000
|
? Number(minimumFlexMintPrice) / 1000000
|
||||||
@ -1919,6 +1920,7 @@ const CollectionCreationPage: NextPage = () => {
|
|||||||
numberOfTokens={uploadDetails?.assetFiles.length}
|
numberOfTokens={uploadDetails?.assetFiles.length}
|
||||||
onChange={setMintingDetails}
|
onChange={setMintingDetails}
|
||||||
uploadMethod={uploadDetails?.uploadMethod as UploadMethod}
|
uploadMethod={uploadDetails?.uploadMethod as UploadMethod}
|
||||||
|
whitelistStartDate={whitelistDetails?.startTime}
|
||||||
/>
|
/>
|
||||||
</Conditional>
|
</Conditional>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user