2023-05-03 08:52:26 +00:00
|
|
|
/* eslint-disable eslint-comments/disable-enable-pair */
|
|
|
|
/* eslint-disable no-nested-ternary */
|
2022-08-04 09:16:42 +00:00
|
|
|
import { FormControl } from 'components/FormControl'
|
|
|
|
import { FormGroup } from 'components/FormGroup'
|
2023-03-08 20:53:12 +00:00
|
|
|
import { AddressList } from 'components/forms/AddressList'
|
|
|
|
import { useAddressListState } from 'components/forms/AddressList.hooks'
|
2022-08-05 11:13:27 +00:00
|
|
|
import { useInputState, useNumberInputState } from 'components/forms/FormInput.hooks'
|
2022-08-04 09:16:42 +00:00
|
|
|
import { InputDateTime } from 'components/InputDateTime'
|
2023-04-27 17:19:42 +00:00
|
|
|
import type { WhitelistFlexMember } from 'components/WhitelistFlexUpload'
|
|
|
|
import { WhitelistFlexUpload } from 'components/WhitelistFlexUpload'
|
2023-08-06 18:09:43 +00:00
|
|
|
import type { TokenInfo } from 'config/token'
|
2023-09-01 12:14:38 +00:00
|
|
|
import { useGlobalSettings } from 'contexts/globalSettings'
|
2022-08-04 09:16:42 +00:00
|
|
|
import React, { useEffect, useState } from 'react'
|
2023-03-08 20:53:12 +00:00
|
|
|
import { isValidAddress } from 'utils/isValidAddress'
|
2023-10-11 23:36:14 +00:00
|
|
|
import { useWallet } from 'utils/wallet'
|
2022-08-04 09:16:42 +00:00
|
|
|
|
|
|
|
import { Conditional } from '../../Conditional'
|
2022-08-05 11:13:27 +00:00
|
|
|
import { AddressInput, NumberInput } from '../../forms/FormInput'
|
2022-08-04 09:16:42 +00:00
|
|
|
import { JsonPreview } from '../../JsonPreview'
|
|
|
|
import { WhitelistUpload } from '../../WhitelistUpload'
|
|
|
|
|
|
|
|
interface WhitelistDetailsProps {
|
|
|
|
onChange: (data: WhitelistDetailsDataProps) => void
|
2023-08-06 18:09:43 +00:00
|
|
|
mintingTokenFromFactory?: TokenInfo
|
2023-07-25 19:27:42 +00:00
|
|
|
importedWhitelistDetails?: WhitelistDetailsDataProps
|
2022-08-04 09:16:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface WhitelistDetailsDataProps {
|
2023-04-24 10:14:06 +00:00
|
|
|
whitelistState: WhitelistState
|
|
|
|
whitelistType: WhitelistType
|
2022-08-04 09:16:42 +00:00
|
|
|
contractAddress?: string
|
2023-04-27 17:19:42 +00:00
|
|
|
members?: string[] | WhitelistFlexMember[]
|
2022-08-04 09:16:42 +00:00
|
|
|
unitPrice?: string
|
|
|
|
startTime?: string
|
|
|
|
endTime?: string
|
|
|
|
perAddressLimit?: number
|
|
|
|
memberLimit?: number
|
2023-03-08 20:53:12 +00:00
|
|
|
admins?: string[]
|
|
|
|
adminsMutable?: boolean
|
2022-08-04 09:16:42 +00:00
|
|
|
}
|
|
|
|
|
2022-08-05 11:13:27 +00:00
|
|
|
type WhitelistState = 'none' | 'existing' | 'new'
|
|
|
|
|
2023-04-24 10:14:06 +00:00
|
|
|
type WhitelistType = 'standard' | 'flex'
|
|
|
|
|
2023-08-08 11:35:46 +00:00
|
|
|
export const WhitelistDetails = ({
|
|
|
|
onChange,
|
|
|
|
mintingTokenFromFactory,
|
|
|
|
importedWhitelistDetails,
|
|
|
|
}: WhitelistDetailsProps) => {
|
2023-08-16 14:57:07 +00:00
|
|
|
const wallet = useWallet()
|
2023-09-01 12:14:38 +00:00
|
|
|
const { timezone } = useGlobalSettings()
|
2023-08-16 14:57:07 +00:00
|
|
|
|
2022-08-05 11:13:27 +00:00
|
|
|
const [whitelistState, setWhitelistState] = useState<WhitelistState>('none')
|
2023-04-24 10:14:06 +00:00
|
|
|
const [whitelistType, setWhitelistType] = useState<WhitelistType>('standard')
|
2022-08-04 09:16:42 +00:00
|
|
|
const [startDate, setStartDate] = useState<Date | undefined>(undefined)
|
|
|
|
const [endDate, setEndDate] = useState<Date | undefined>(undefined)
|
2023-04-27 17:19:42 +00:00
|
|
|
const [whitelistStandardArray, setWhitelistStandardArray] = useState<string[]>([])
|
|
|
|
const [whitelistFlexArray, setWhitelistFlexArray] = useState<WhitelistFlexMember[]>([])
|
2023-03-18 08:18:34 +00:00
|
|
|
const [adminsMutable, setAdminsMutable] = useState<boolean>(true)
|
2022-08-04 09:16:42 +00:00
|
|
|
|
2022-08-05 11:13:27 +00:00
|
|
|
const whitelistAddressState = useInputState({
|
|
|
|
id: 'whitelist-address',
|
|
|
|
name: 'whitelistAddress',
|
|
|
|
title: 'Whitelist Address',
|
2022-08-09 11:42:55 +00:00
|
|
|
defaultValue: '',
|
2022-08-05 11:13:27 +00:00
|
|
|
})
|
|
|
|
|
2022-11-04 11:53:11 +00:00
|
|
|
const unitPriceState = useNumberInputState({
|
2022-08-04 09:16:42 +00:00
|
|
|
id: 'unit-price',
|
|
|
|
name: 'unitPrice',
|
|
|
|
title: 'Unit Price',
|
2023-08-06 18:09:43 +00:00
|
|
|
subtitle: `Token price for whitelisted addresses \n (min. 0 ${
|
|
|
|
mintingTokenFromFactory ? mintingTokenFromFactory.displayName : 'STARS'
|
|
|
|
})`,
|
2022-09-01 06:27:23 +00:00
|
|
|
placeholder: '25',
|
2022-08-04 09:16:42 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
const memberLimitState = useNumberInputState({
|
|
|
|
id: 'member-limit',
|
|
|
|
name: 'memberLimit',
|
|
|
|
title: 'Member Limit',
|
2022-09-01 06:27:23 +00:00
|
|
|
subtitle: 'Maximum number of whitelisted addresses',
|
2022-08-04 09:16:42 +00:00
|
|
|
placeholder: '1000',
|
|
|
|
})
|
|
|
|
|
|
|
|
const perAddressLimitState = useNumberInputState({
|
|
|
|
id: 'per-address-limit',
|
|
|
|
name: 'perAddressLimit',
|
|
|
|
title: 'Per Address Limit',
|
2022-09-01 06:27:23 +00:00
|
|
|
subtitle: 'Maximum number of tokens per whitelisted address',
|
2022-08-04 09:16:42 +00:00
|
|
|
placeholder: '5',
|
|
|
|
})
|
|
|
|
|
2023-03-08 20:53:12 +00:00
|
|
|
const addressListState = useAddressListState()
|
|
|
|
|
2022-08-04 09:16:42 +00:00
|
|
|
const whitelistFileOnChange = (data: string[]) => {
|
2023-04-27 17:19:42 +00:00
|
|
|
setWhitelistStandardArray(data)
|
2022-08-04 09:16:42 +00:00
|
|
|
}
|
|
|
|
|
2023-04-27 17:19:42 +00:00
|
|
|
const whitelistFlexFileOnChange = (whitelistData: WhitelistFlexMember[]) => {
|
|
|
|
setWhitelistFlexArray(whitelistData)
|
|
|
|
}
|
|
|
|
|
|
|
|
useEffect(() => {
|
2023-07-25 19:27:42 +00:00
|
|
|
if (!importedWhitelistDetails) {
|
|
|
|
setWhitelistStandardArray([])
|
|
|
|
setWhitelistFlexArray([])
|
|
|
|
}
|
2023-04-27 17:19:42 +00:00
|
|
|
}, [whitelistType])
|
|
|
|
|
2022-08-04 09:16:42 +00:00
|
|
|
useEffect(() => {
|
|
|
|
const data: WhitelistDetailsDataProps = {
|
2023-04-24 10:14:06 +00:00
|
|
|
whitelistState,
|
|
|
|
whitelistType,
|
2022-11-18 16:50:33 +00:00
|
|
|
contractAddress: whitelistAddressState.value
|
|
|
|
.toLowerCase()
|
|
|
|
.replace(/,/g, '')
|
|
|
|
.replace(/"/g, '')
|
|
|
|
.replace(/'/g, '')
|
|
|
|
.replace(/ /g, ''),
|
2023-04-27 17:19:42 +00:00
|
|
|
members: whitelistType === 'standard' ? whitelistStandardArray : whitelistFlexArray,
|
2023-05-03 08:52:26 +00:00
|
|
|
unitPrice: unitPriceState.value
|
|
|
|
? (Number(unitPriceState.value) * 1_000_000).toString()
|
|
|
|
: unitPriceState.value === 0
|
|
|
|
? '0'
|
|
|
|
: undefined,
|
2022-08-04 09:16:42 +00:00
|
|
|
startTime: startDate ? (startDate.getTime() * 1_000_000).toString() : '',
|
|
|
|
endTime: endDate ? (endDate.getTime() * 1_000_000).toString() : '',
|
|
|
|
perAddressLimit: perAddressLimitState.value,
|
|
|
|
memberLimit: memberLimitState.value,
|
2023-03-08 20:53:12 +00:00
|
|
|
admins: [
|
|
|
|
...new Set(
|
|
|
|
addressListState.values
|
|
|
|
.map((a) => a.address.trim())
|
|
|
|
.filter((address) => address !== '' && isValidAddress(address.trim()) && address.startsWith('stars')),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
adminsMutable,
|
2022-08-04 09:16:42 +00:00
|
|
|
}
|
|
|
|
onChange(data)
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
2022-08-09 11:42:55 +00:00
|
|
|
}, [
|
|
|
|
whitelistAddressState.value,
|
2022-11-04 11:53:11 +00:00
|
|
|
unitPriceState.value,
|
2022-08-09 11:42:55 +00:00
|
|
|
memberLimitState.value,
|
|
|
|
perAddressLimitState.value,
|
|
|
|
startDate,
|
|
|
|
endDate,
|
2023-04-27 17:19:42 +00:00
|
|
|
whitelistStandardArray,
|
|
|
|
whitelistFlexArray,
|
2022-08-09 11:42:55 +00:00
|
|
|
whitelistState,
|
2023-03-08 20:53:12 +00:00
|
|
|
addressListState.values,
|
|
|
|
adminsMutable,
|
2022-08-09 11:42:55 +00:00
|
|
|
])
|
2022-08-04 09:16:42 +00:00
|
|
|
|
2023-07-25 19:27:42 +00:00
|
|
|
// make the necessary changes with respect to imported whitelist details
|
|
|
|
useEffect(() => {
|
|
|
|
if (importedWhitelistDetails) {
|
|
|
|
setWhitelistState(importedWhitelistDetails.whitelistState)
|
|
|
|
setWhitelistType(importedWhitelistDetails.whitelistType)
|
|
|
|
whitelistAddressState.onChange(
|
|
|
|
importedWhitelistDetails.contractAddress ? importedWhitelistDetails.contractAddress : '',
|
|
|
|
)
|
2023-08-21 13:29:52 +00:00
|
|
|
unitPriceState.onChange(
|
|
|
|
importedWhitelistDetails.unitPrice ? Number(importedWhitelistDetails.unitPrice) / 1000000 : 0,
|
|
|
|
)
|
2023-07-25 19:27:42 +00:00
|
|
|
memberLimitState.onChange(importedWhitelistDetails.memberLimit ? importedWhitelistDetails.memberLimit : 0)
|
|
|
|
perAddressLimitState.onChange(
|
|
|
|
importedWhitelistDetails.perAddressLimit ? importedWhitelistDetails.perAddressLimit : 0,
|
|
|
|
)
|
|
|
|
setStartDate(
|
|
|
|
importedWhitelistDetails.startTime
|
|
|
|
? new Date(Number(importedWhitelistDetails.startTime) / 1_000_000)
|
|
|
|
: undefined,
|
|
|
|
)
|
|
|
|
setEndDate(
|
|
|
|
importedWhitelistDetails.endTime ? new Date(Number(importedWhitelistDetails.endTime) / 1_000_000) : undefined,
|
|
|
|
)
|
|
|
|
setAdminsMutable(importedWhitelistDetails.adminsMutable ? importedWhitelistDetails.adminsMutable : true)
|
|
|
|
importedWhitelistDetails.admins?.forEach((admin) => {
|
|
|
|
addressListState.reset()
|
|
|
|
addressListState.add({ address: admin })
|
|
|
|
})
|
|
|
|
if (importedWhitelistDetails.whitelistType === 'standard') {
|
|
|
|
setWhitelistStandardArray([])
|
|
|
|
importedWhitelistDetails.members?.forEach((member) => {
|
|
|
|
setWhitelistStandardArray((standardArray) => [...standardArray, member as string])
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
setWhitelistFlexArray([])
|
|
|
|
importedWhitelistDetails.members?.forEach((member) => {
|
|
|
|
setWhitelistFlexArray((flexArray) => [
|
|
|
|
...flexArray,
|
|
|
|
{
|
|
|
|
address: (member as WhitelistFlexMember).address,
|
|
|
|
mint_count: (member as WhitelistFlexMember).mint_count,
|
|
|
|
},
|
|
|
|
])
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
}, [importedWhitelistDetails])
|
|
|
|
|
2023-08-16 14:57:07 +00:00
|
|
|
useEffect(() => {
|
|
|
|
if (whitelistState === 'new' && wallet.address) {
|
|
|
|
addressListState.reset()
|
|
|
|
addressListState.add({ address: wallet.address })
|
|
|
|
}
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
}, [whitelistState, wallet.address])
|
|
|
|
|
2022-08-04 09:16:42 +00:00
|
|
|
return (
|
2022-08-05 11:13:27 +00:00
|
|
|
<div className="py-3 px-8 rounded border-2 border-white/20">
|
|
|
|
<div className="flex justify-center">
|
|
|
|
<div className="ml-4 font-bold form-check form-check-inline">
|
|
|
|
<input
|
|
|
|
checked={whitelistState === 'none'}
|
2022-09-13 05:19:04 +00:00
|
|
|
className="peer sr-only"
|
2022-08-05 11:13:27 +00:00
|
|
|
id="whitelistRadio1"
|
|
|
|
name="whitelistRadioOptions1"
|
|
|
|
onClick={() => {
|
|
|
|
setWhitelistState('none')
|
2023-04-28 12:00:39 +00:00
|
|
|
setWhitelistType('standard')
|
2022-08-05 11:13:27 +00:00
|
|
|
}}
|
|
|
|
type="radio"
|
|
|
|
value="None"
|
|
|
|
/>
|
2022-09-13 05:19:04 +00:00
|
|
|
<label
|
2022-09-19 08:14:30 +00:00
|
|
|
className="inline-block py-1 px-2 text-gray peer-checked:text-white hover:text-white peer-checked:bg-black hover:rounded-sm peer-checked:border-b-2 hover:border-b-2 peer-checked:border-plumbus hover:border-plumbus cursor-pointer form-check-label"
|
2022-09-13 05:19:04 +00:00
|
|
|
htmlFor="whitelistRadio1"
|
|
|
|
>
|
2022-08-05 11:13:27 +00:00
|
|
|
No whitelist
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div className="ml-4 font-bold form-check form-check-inline">
|
|
|
|
<input
|
|
|
|
checked={whitelistState === 'existing'}
|
2022-09-13 05:19:04 +00:00
|
|
|
className="peer sr-only"
|
2022-08-05 11:13:27 +00:00
|
|
|
id="whitelistRadio2"
|
|
|
|
name="whitelistRadioOptions2"
|
|
|
|
onClick={() => {
|
|
|
|
setWhitelistState('existing')
|
|
|
|
}}
|
|
|
|
type="radio"
|
|
|
|
value="Existing"
|
|
|
|
/>
|
2022-09-13 05:19:04 +00:00
|
|
|
<label
|
2022-09-19 08:14:30 +00:00
|
|
|
className="inline-block py-1 px-2 text-gray peer-checked:text-white hover:text-white peer-checked:bg-black hover:rounded-sm peer-checked:border-b-2 hover:border-b-2 peer-checked:border-plumbus hover:border-plumbus cursor-pointer form-check-label"
|
2022-09-13 05:19:04 +00:00
|
|
|
htmlFor="whitelistRadio2"
|
|
|
|
>
|
2022-08-05 11:13:27 +00:00
|
|
|
Existing whitelist
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div className="ml-4 font-bold form-check form-check-inline">
|
|
|
|
<input
|
|
|
|
checked={whitelistState === 'new'}
|
2022-09-13 05:19:04 +00:00
|
|
|
className="peer sr-only"
|
2022-08-05 11:13:27 +00:00
|
|
|
id="whitelistRadio3"
|
|
|
|
name="whitelistRadioOptions3"
|
|
|
|
onClick={() => {
|
|
|
|
setWhitelistState('new')
|
|
|
|
}}
|
|
|
|
type="radio"
|
|
|
|
value="New"
|
|
|
|
/>
|
2022-09-13 05:19:04 +00:00
|
|
|
<label
|
2022-09-19 08:14:30 +00:00
|
|
|
className="inline-block py-1 px-2 text-gray peer-checked:text-white hover:text-white peer-checked:bg-black hover:rounded-sm peer-checked:border-b-2 hover:border-b-2 peer-checked:border-plumbus hover:border-plumbus cursor-pointer form-check-label"
|
2022-09-13 05:19:04 +00:00
|
|
|
htmlFor="whitelistRadio3"
|
|
|
|
>
|
2022-08-05 11:13:27 +00:00
|
|
|
New whitelist
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<Conditional test={whitelistState === 'existing'}>
|
2022-09-01 06:27:23 +00:00
|
|
|
<AddressInput {...whitelistAddressState} className="pb-5" isRequired />
|
2022-08-05 11:13:27 +00:00
|
|
|
</Conditional>
|
|
|
|
|
|
|
|
<Conditional test={whitelistState === 'new'}>
|
2023-04-27 17:19:42 +00:00
|
|
|
<div className="flex justify-between mb-5 ml-6 max-w-[300px] text-lg font-bold">
|
|
|
|
<div className="form-check form-check-inline">
|
|
|
|
<input
|
|
|
|
checked={whitelistType === 'standard'}
|
|
|
|
className="peer sr-only"
|
|
|
|
id="inlineRadio7"
|
|
|
|
name="inlineRadioOptions7"
|
|
|
|
onClick={() => {
|
|
|
|
setWhitelistType('standard')
|
|
|
|
}}
|
|
|
|
type="radio"
|
|
|
|
value="nft-storage"
|
|
|
|
/>
|
|
|
|
<label
|
|
|
|
className="inline-block py-1 px-2 text-gray peer-checked:text-white hover:text-white peer-checked:bg-black hover:rounded-sm peer-checked:border-b-2 hover:border-b-2 peer-checked:border-plumbus hover:border-plumbus cursor-pointer form-check-label"
|
|
|
|
htmlFor="inlineRadio7"
|
|
|
|
>
|
|
|
|
Standard Whitelist
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className="form-check form-check-inline">
|
|
|
|
<input
|
|
|
|
checked={whitelistType === 'flex'}
|
|
|
|
className="peer sr-only"
|
|
|
|
id="inlineRadio8"
|
|
|
|
name="inlineRadioOptions8"
|
|
|
|
onClick={() => {
|
|
|
|
setWhitelistType('flex')
|
|
|
|
}}
|
|
|
|
type="radio"
|
|
|
|
value="flex"
|
|
|
|
/>
|
|
|
|
<label
|
|
|
|
className="inline-block py-1 px-2 text-gray peer-checked:text-white hover:text-white peer-checked:bg-black hover:rounded-sm peer-checked:border-b-2 hover:border-b-2 peer-checked:border-plumbus hover:border-plumbus cursor-pointer form-check-label"
|
|
|
|
htmlFor="inlineRadio8"
|
|
|
|
>
|
|
|
|
Whitelist Flex
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-08-05 11:13:27 +00:00
|
|
|
<div className="grid grid-cols-2">
|
|
|
|
<FormGroup subtitle="Information about your minting settings" title="Whitelist Minting Details">
|
2022-11-04 11:53:11 +00:00
|
|
|
<NumberInput isRequired {...unitPriceState} />
|
2022-08-05 11:13:27 +00:00
|
|
|
<NumberInput isRequired {...memberLimitState} />
|
2023-04-27 17:19:42 +00:00
|
|
|
<Conditional test={whitelistType === 'standard'}>
|
|
|
|
<NumberInput isRequired {...perAddressLimitState} />
|
|
|
|
</Conditional>
|
2022-09-01 06:27:23 +00:00
|
|
|
<FormControl
|
|
|
|
htmlId="start-date"
|
|
|
|
isRequired
|
|
|
|
subtitle="Start time for minting tokens to whitelisted addresses"
|
2023-09-01 12:14:38 +00:00
|
|
|
title={`Start Time ${timezone === 'Local' ? '(local)' : '(UTC)'}`}
|
2022-09-01 06:27:23 +00:00
|
|
|
>
|
2023-09-01 12:14:38 +00:00
|
|
|
<InputDateTime
|
|
|
|
minDate={
|
|
|
|
timezone === 'Local' ? new Date() : new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000)
|
|
|
|
}
|
|
|
|
onChange={(date) =>
|
|
|
|
setStartDate(
|
|
|
|
timezone === 'Local' ? date : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
value={
|
|
|
|
timezone === 'Local'
|
|
|
|
? startDate
|
|
|
|
: startDate
|
|
|
|
? new Date(startDate.getTime() + new Date().getTimezoneOffset() * 60 * 1000)
|
|
|
|
: undefined
|
|
|
|
}
|
|
|
|
/>
|
2022-08-05 11:13:27 +00:00
|
|
|
</FormControl>
|
2022-09-01 06:27:23 +00:00
|
|
|
<FormControl
|
|
|
|
htmlId="end-date"
|
|
|
|
isRequired
|
|
|
|
subtitle="End time for minting tokens to whitelisted addresses"
|
2023-09-01 12:14:38 +00:00
|
|
|
title={`End Time ${timezone === 'Local' ? '(local)' : '(UTC)'}`}
|
2022-09-01 06:27:23 +00:00
|
|
|
>
|
2023-09-01 12:14:38 +00:00
|
|
|
<InputDateTime
|
|
|
|
minDate={
|
|
|
|
timezone === 'Local' ? new Date() : new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000)
|
|
|
|
}
|
|
|
|
onChange={(date) =>
|
|
|
|
setEndDate(
|
|
|
|
timezone === 'Local' ? date : new Date(date.getTime() - new Date().getTimezoneOffset() * 60 * 1000),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
value={
|
|
|
|
timezone === 'Local'
|
|
|
|
? endDate
|
|
|
|
: endDate
|
|
|
|
? new Date(endDate.getTime() + new Date().getTimezoneOffset() * 60 * 1000)
|
|
|
|
: undefined
|
|
|
|
}
|
|
|
|
/>
|
2022-08-05 11:13:27 +00:00
|
|
|
</FormControl>
|
|
|
|
</FormGroup>
|
|
|
|
<div>
|
2023-03-18 08:18:34 +00:00
|
|
|
<div className="mt-2 ml-3 w-[65%] form-control">
|
2023-03-08 20:53:12 +00:00
|
|
|
<label className="justify-start cursor-pointer label">
|
|
|
|
<span className="mr-4 font-bold">Mutable Administrator Addresses</span>
|
|
|
|
<input
|
|
|
|
checked={adminsMutable}
|
|
|
|
className={`toggle ${adminsMutable ? `bg-stargaze` : `bg-gray-600`}`}
|
|
|
|
onClick={() => setAdminsMutable(!adminsMutable)}
|
|
|
|
type="checkbox"
|
|
|
|
/>
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
<div className="my-4 ml-4">
|
|
|
|
<AddressList
|
|
|
|
entries={addressListState.entries}
|
|
|
|
onAdd={addressListState.add}
|
|
|
|
onChange={addressListState.update}
|
|
|
|
onRemove={addressListState.remove}
|
|
|
|
subtitle="The list of administrator addresses"
|
|
|
|
title="Administrator Addresses"
|
|
|
|
/>
|
|
|
|
</div>
|
2023-04-27 17:19:42 +00:00
|
|
|
<Conditional test={whitelistType === 'standard'}>
|
|
|
|
<FormGroup subtitle="TXT file that contains the whitelisted addresses" title="Whitelist File">
|
|
|
|
<WhitelistUpload onChange={whitelistFileOnChange} />
|
|
|
|
</FormGroup>
|
|
|
|
<Conditional test={whitelistStandardArray.length > 0}>
|
|
|
|
<JsonPreview content={whitelistStandardArray} initialState title="File Contents" />
|
|
|
|
</Conditional>
|
|
|
|
</Conditional>
|
|
|
|
<Conditional test={whitelistType === 'flex'}>
|
|
|
|
<FormGroup
|
|
|
|
subtitle="CSV file that contains the whitelisted addresses and their corresponding mint counts"
|
|
|
|
title="Whitelist File"
|
|
|
|
>
|
|
|
|
<WhitelistFlexUpload onChange={whitelistFlexFileOnChange} />
|
|
|
|
</FormGroup>
|
|
|
|
<Conditional test={whitelistFlexArray.length > 0}>
|
|
|
|
<JsonPreview content={whitelistFlexArray} initialState={false} title="File Contents" />
|
|
|
|
</Conditional>
|
2022-08-05 11:13:27 +00:00
|
|
|
</Conditional>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Conditional>
|
2022-08-04 09:16:42 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|