diff --git a/components/collections/creation/CollectionDetails.tsx b/components/collections/creation/CollectionDetails.tsx index 6e039e8..13a137f 100644 --- a/components/collections/creation/CollectionDetails.tsx +++ b/components/collections/creation/CollectionDetails.tsx @@ -192,11 +192,13 @@ export const CollectionDetails = ({ : new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000) } onChange={(date) => - setTimestamp( - timezone === 'Local' - ? date - : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), - ) + date + ? setTimestamp( + timezone === 'Local' + ? date + : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), + ) + : setTimestamp(undefined) } value={ timezone === 'Local' diff --git a/components/collections/creation/MintingDetails.tsx b/components/collections/creation/MintingDetails.tsx index ed44002..e03752f 100644 --- a/components/collections/creation/MintingDetails.tsx +++ b/components/collections/creation/MintingDetails.tsx @@ -1,4 +1,5 @@ /* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable @typescript-eslint/no-unnecessary-condition */ /* eslint-disable no-nested-ternary */ import { FormControl } from 'components/FormControl' import { FormGroup } from 'components/FormGroup' @@ -22,6 +23,8 @@ interface MintingDetailsProps { minimumMintPrice: number mintingTokenFromFactory?: TokenInfo importedMintingDetails?: MintingDetailsDataProps + isPresale: boolean + whitelistStartDate?: string } export interface MintingDetailsDataProps { @@ -40,6 +43,8 @@ export const MintingDetails = ({ minimumMintPrice, mintingTokenFromFactory, importedMintingDetails, + isPresale, + whitelistStartDate, }: MintingDetailsProps) => { const wallet = useWallet() const { timezone } = useGlobalSettings() @@ -129,6 +134,12 @@ export const MintingDetails = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [importedMintingDetails]) + useEffect(() => { + if (isPresale) { + setTimestamp(whitelistStartDate ? new Date(Number(whitelistStartDate) / 1_000_000) : undefined) + } + }, [whitelistStartDate, isPresale]) + return (
@@ -162,17 +173,22 @@ export const MintingDetails = ({ - setTimestamp( - timezone === 'Local' ? date : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), - ) + date + ? setTimestamp( + timezone === 'Local' ? date : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), + ) + : setTimestamp(undefined) } value={ timezone === 'Local' diff --git a/components/collections/creation/WhitelistDetails.tsx b/components/collections/creation/WhitelistDetails.tsx index b32fcad..2bd08a6 100644 --- a/components/collections/creation/WhitelistDetails.tsx +++ b/components/collections/creation/WhitelistDetails.tsx @@ -1,4 +1,5 @@ /* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable @typescript-eslint/no-unnecessary-condition */ /* eslint-disable no-nested-ternary */ import { FormControl } from 'components/FormControl' import { FormGroup } from 'components/FormGroup' @@ -331,16 +332,20 @@ export const WhitelistDetails = ({ htmlId="start-date" isRequired subtitle="Start time for minting tokens to whitelisted addresses" - title={`Start Time ${timezone === 'Local' ? '(local)' : '(UTC)'}`} + title={`Whitelist Start Time ${timezone === 'Local' ? '(local)' : '(UTC)'}`} > - setStartDate( - timezone === 'Local' ? date : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), - ) + date + ? setStartDate( + timezone === 'Local' + ? date + : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), + ) + : setStartDate(undefined) } value={ timezone === 'Local' @@ -354,17 +359,21 @@ export const WhitelistDetails = ({ - setEndDate( - timezone === 'Local' ? date : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), - ) + date + ? setEndDate( + timezone === 'Local' + ? date + : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), + ) + : setEndDate(undefined) } value={ timezone === 'Local' diff --git a/components/openEdition/CollectionDetails.tsx b/components/openEdition/CollectionDetails.tsx index 1ed1014..994cb75 100644 --- a/components/openEdition/CollectionDetails.tsx +++ b/components/openEdition/CollectionDetails.tsx @@ -236,9 +236,13 @@ export const CollectionDetails = ({ timezone === 'Local' ? new Date() : new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000) } onChange={(date) => - setTimestamp( - timezone === 'Local' ? date : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), - ) + date + ? setTimestamp( + timezone === 'Local' + ? date + : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), + ) + : setTimestamp(undefined) } value={ timezone === 'Local' diff --git a/components/openEdition/MintingDetails.tsx b/components/openEdition/MintingDetails.tsx index 4671a37..7ccded2 100644 --- a/components/openEdition/MintingDetails.tsx +++ b/components/openEdition/MintingDetails.tsx @@ -1,4 +1,5 @@ /* eslint-disable eslint-comments/disable-enable-pair */ +/* eslint-disable @typescript-eslint/no-unnecessary-condition */ /* eslint-disable no-nested-ternary */ import { Conditional } from 'components/Conditional' import { FormControl } from 'components/FormControl' @@ -175,9 +176,11 @@ export const MintingDetails = ({ timezone === 'Local' ? new Date() : new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000) } onChange={(date) => - setTimestamp( - timezone === 'Local' ? date : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), - ) + date + ? setTimestamp( + timezone === 'Local' ? date : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000), + ) + : setTimestamp(undefined) } value={ timezone === 'Local' @@ -188,6 +191,7 @@ export const MintingDetails = ({ } /> +

Limit Type: