Render WL admin list mutable by default

This commit is contained in:
Serkan Reis 2023-03-18 11:18:34 +03:00
parent 68961ce5f3
commit 2c2fc2efbe
3 changed files with 8 additions and 4 deletions

View File

@ -36,7 +36,7 @@ export const WhitelistDetails = ({ onChange }: WhitelistDetailsProps) => {
const [startDate, setStartDate] = useState<Date | undefined>(undefined) const [startDate, setStartDate] = useState<Date | undefined>(undefined)
const [endDate, setEndDate] = useState<Date | undefined>(undefined) const [endDate, setEndDate] = useState<Date | undefined>(undefined)
const [whitelistArray, setWhitelistArray] = useState<string[]>([]) const [whitelistArray, setWhitelistArray] = useState<string[]>([])
const [adminsMutable, setAdminsMutable] = useState<boolean>(false) const [adminsMutable, setAdminsMutable] = useState<boolean>(true)
const whitelistAddressState = useInputState({ const whitelistAddressState = useInputState({
id: 'whitelist-address', id: 'whitelist-address',
@ -204,7 +204,7 @@ export const WhitelistDetails = ({ onChange }: WhitelistDetailsProps) => {
</FormControl> </FormControl>
</FormGroup> </FormGroup>
<div> <div>
<div className="mt-2 ml-3 w-full form-control"> <div className="mt-2 ml-3 w-[65%] form-control">
<label className="justify-start cursor-pointer label"> <label className="justify-start cursor-pointer label">
<span className="mr-4 font-bold">Mutable Administrator Addresses</span> <span className="mr-4 font-bold">Mutable Administrator Addresses</span>
<input <input

View File

@ -27,5 +27,9 @@ export function useAddressListState() {
}) })
} }
return { entries, values, add, update, remove } function reset() {
setRecord({})
}
return { entries, values, add, update, remove, reset }
} }

View File

@ -35,7 +35,7 @@ const WhitelistInstantiatePage: NextPage = () => {
const [startDate, setStartDate] = useState<Date | undefined>(undefined) const [startDate, setStartDate] = useState<Date | undefined>(undefined)
const [endDate, setEndDate] = useState<Date | undefined>(undefined) const [endDate, setEndDate] = useState<Date | undefined>(undefined)
const [adminsMutable, setAdminsMutable] = useState<boolean>(false) const [adminsMutable, setAdminsMutable] = useState<boolean>(true)
const [whitelistArray, setWhitelistArray] = useState<string[]>([]) const [whitelistArray, setWhitelistArray] = useState<string[]>([])