-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview freeze pallet proposal #4627
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…iew-freeze-pallet-proposal
onChange: (option: PalletFrozenStatus) => void | ||
} | ||
|
||
export const OptionsPalletFrozenStatus = React.memo(({ onChange }: Props) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this file is not needed
selectedStatus?: boolean | ||
onChange: (selected: PalletFrozenStatus) => void | ||
} | ||
export const SelectPalletFrozenStatus = ({ selectedStatus, onChange }: Props) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
export const UpdatePalletFrozenStatus = () => { | ||
const { watch, setValue } = useFormContext() | ||
|
||
const setPalletFrozenStatus = (selected: PalletFrozenStatus) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one too
@@ -80,6 +80,10 @@ export type UpdateChannelPayoutsDetail = { | |||
payloadHash?: string | |||
payloadDataObjectId?: string | |||
} | |||
export type UpdatePalletFrozenStatusDetail = { | |||
frozen?: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too please change frozen
to freeze
because it's the action that the proposal should apply (not the current state).
{ | ||
label: 'Proposed Status', | ||
renderType: 'Text', | ||
value: value ? 'Enable' : 'Disable', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's the opposite if we want to freeze the pallet the proposed status is "Disable" otherwise "Enabled".
Also please rename value to freezePallet
renderType: 'Text', | ||
value: value ? 'Enable' : 'Disable', | ||
}, | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the pallet should be displayed too
value: value ? 'Enable' : 'Disable', | ||
}, | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I'm wondering if the current pallet state should be displayed too. WDYT @dmtrjsg @chrlschwb ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that's good to have.
@@ -359,6 +369,12 @@ const asUpdateChannelPayouts: DetailsCast<'UpdateChannelPayoutsProposalDetails'> | |||
payloadDataObjectId: extra?.payloadDataObjectId, | |||
}) | |||
|
|||
const asUpdatePalletFrozenStatus: DetailsCast<'UpdatePalletFrozenStatusProposalDetails'> = (fragment) => ({ | |||
type: 'updatePalletFrozenStatus', | |||
frozen: fragment.frozen, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frozen: fragment.frozen, | |
freeze: fragment.frozen, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 🙌
Preview freeze pallet proposal and continuation of this PR #4625
┆Issue is synchronized with this Asana task by Unito