feat: drag account groups and separate grouped card rows
This commit is contained in:
1 parent
59837cf09c
commit
9a133e82e9
13 files changed
+360
-94
No files matched your search
@@ -6,3 +6,12 @@ export function orderedGroups(groups: string[], order: string[] = []) {
|
||||
export function mergeGroupOrder(visible: string[], saved: string[]) {
|
||||
return [...visible, ...saved.filter((g) => !visible.includes(g))];
|
||||
}
|
||||
|
||||
export function moveGroup(groups: string[], from: number, to: number) {
|
||||
if (from === to || from < 0 || to < 0 || from >= groups.length || to >= groups.length)
|
||||
return groups;
|
||||
const next = [...groups],
|
||||
[group] = next.splice(from, 1);
|
||||
next.splice(to, 0, group);
|
||||
return next;
|
||||
}
|
||||
Reference in new issue
Block a user