feat: ability to change the order of signers in create screen #61

Merged
s merged 3 commits from issue-33 into main 2024-05-20 08:30:16 +00:00
Showing only changes of commit e0b1b4a172 - Show all commits

View File

@ -168,7 +168,13 @@ export const CreatePage = () => {
setUsers((prev) => prev.filter((user) => user.pubkey !== pubkey))
}
const moveSinger = (dragIndex: number, hoverIndex: number) => {
/**
* changes the position of signer in the signers list
*
* @param dragIndex represents the current position of user
* @param hoverIndex represents the target position of user
*/
const moveSigner = (dragIndex: number, hoverIndex: number) => {
setUsers((prevUsers) => {
const updatedUsers = [...prevUsers]
const [draggedUser] = updatedUsers.splice(dragIndex, 1)
@ -448,7 +454,7 @@ export const CreatePage = () => {
users={users}
handleUserRoleChange={handleUserRoleChange}
handleRemoveUser={handleRemoveUser}
moveSigner={moveSinger}
moveSigner={moveSigner}
/>
<Box sx={{ mt: 1, display: 'flex', justifyContent: 'center' }}>
<Button onClick={handleCreate} variant="contained">