Enable Purge Keys/Owners on Badge Actions > Actions
This commit is contained in:
parent
0696e83bfa
commit
3a5dd27dff
@ -34,7 +34,7 @@ import { isValidAddress } from 'utils/isValidAddress'
|
|||||||
import { resolveAddress } from 'utils/resolveAddress'
|
import { resolveAddress } from 'utils/resolveAddress'
|
||||||
|
|
||||||
import { BadgeAirdropListUpload } from '../../BadgeAirdropListUpload'
|
import { BadgeAirdropListUpload } from '../../BadgeAirdropListUpload'
|
||||||
import { AddressInput, TextInput } from '../../forms/FormInput'
|
import { AddressInput, NumberInput, TextInput } from '../../forms/FormInput'
|
||||||
import type { MintRule } from '../creation/ImageUploadDetails'
|
import type { MintRule } from '../creation/ImageUploadDetails'
|
||||||
|
|
||||||
interface BadgeActionsProps {
|
interface BadgeActionsProps {
|
||||||
@ -186,7 +186,7 @@ export const BadgeActions = ({ badgeHubContractAddress, badgeId, badgeHubMessage
|
|||||||
id: 'limit',
|
id: 'limit',
|
||||||
name: 'limit',
|
name: 'limit',
|
||||||
title: 'Limit',
|
title: 'Limit',
|
||||||
subtitle: 'Number of keys/owners to execute the action for',
|
subtitle: 'Number of keys/owners to execute the action for (0 for all)',
|
||||||
})
|
})
|
||||||
|
|
||||||
const showMetadataField = isEitherType(type, ['edit_badge'])
|
const showMetadataField = isEitherType(type, ['edit_badge'])
|
||||||
@ -195,6 +195,7 @@ export const BadgeActions = ({ badgeHubContractAddress, badgeId, badgeHubMessage
|
|||||||
const showAirdropFileField = isEitherType(type, ['airdrop_by_key'])
|
const showAirdropFileField = isEitherType(type, ['airdrop_by_key'])
|
||||||
const showOwnerList = isEitherType(type, ['mint_by_minter'])
|
const showOwnerList = isEitherType(type, ['mint_by_minter'])
|
||||||
const showPubKeyField = isEitherType(type, ['mint_by_keys'])
|
const showPubKeyField = isEitherType(type, ['mint_by_keys'])
|
||||||
|
const showLimitState = isEitherType(type, ['purge_keys', 'purge_owners'])
|
||||||
|
|
||||||
const payload: DispatchExecuteArgs = {
|
const payload: DispatchExecuteArgs = {
|
||||||
badge: {
|
badge: {
|
||||||
@ -250,7 +251,7 @@ export const BadgeActions = ({ badgeHubContractAddress, badgeId, badgeHubMessage
|
|||||||
pubkey: pubKeyState.value,
|
pubkey: pubKeyState.value,
|
||||||
signature,
|
signature,
|
||||||
keys: [],
|
keys: [],
|
||||||
limit: limitState.value,
|
limit: limitState.value || undefined,
|
||||||
owners: [
|
owners: [
|
||||||
...new Set(
|
...new Set(
|
||||||
ownerListState.values
|
ownerListState.values
|
||||||
@ -527,6 +528,7 @@ export const BadgeActions = ({ badgeHubContractAddress, badgeId, badgeHubMessage
|
|||||||
)}
|
)}
|
||||||
{showPubKeyField && <TextInput className="mt-2" {...pubKeyState} />}
|
{showPubKeyField && <TextInput className="mt-2" {...pubKeyState} />}
|
||||||
{showPrivateKeyField && <TextInput className="mt-2" {...privateKeyState} />}
|
{showPrivateKeyField && <TextInput className="mt-2" {...privateKeyState} />}
|
||||||
|
{showLimitState && <NumberInput className="mt-2" {...limitState} />}
|
||||||
|
|
||||||
<Conditional test={showOwnerList}>
|
<Conditional test={showOwnerList}>
|
||||||
<div className="mt-4">
|
<div className="mt-4">
|
||||||
|
Loading…
Reference in New Issue
Block a user