Skip to content

Commit 33ff667

Browse files
authored
Merge commit from fork
1 parent e96015f commit 33ff667

File tree

2 files changed

+180
-192
lines changed

2 files changed

+180
-192
lines changed

src/components/pages/folders/modals/DeleteFolderModal.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { IconTrashFilled } from '@tabler/icons-react';
1010
import { useMemo, useState } from 'react';
1111
import { mutate } from 'swr';
1212

13-
type ChildrenAction = 'moveToRoot' | 'moveToFolder' | 'cascade';
13+
type ChildrenAction = 'root' | 'folder' | 'cascade';
1414

1515
export default function DeleteFolderModal({
1616
folder,
@@ -22,7 +22,7 @@ export default function DeleteFolderModal({
2222
onClose: () => void;
2323
}) {
2424
const [loading, setLoading] = useState(false);
25-
const [childrenAction, setChildrenAction] = useState<ChildrenAction>('moveToRoot');
25+
const [childrenAction, setChildrenAction] = useState<ChildrenAction>('root');
2626
const [targetFolderId, setTargetFolderId] = useState<string | null>(null);
2727
const [search, setSearch] = useState('');
2828
const combobox = useCombobox();
@@ -56,7 +56,7 @@ export default function DeleteFolderModal({
5656

5757
if (hasContent) {
5858
body.childrenAction = childrenAction;
59-
if (childrenAction === 'moveToFolder') {
59+
if (childrenAction === 'folder') {
6060
if (!targetFolderId) {
6161
notifications.show({
6262
title: 'No folder selected',
@@ -112,8 +112,8 @@ export default function DeleteFolderModal({
112112

113113
<Radio.Group value={childrenAction} onChange={(v) => setChildrenAction(v as ChildrenAction)}>
114114
<Stack gap='xs'>
115-
<Radio value='moveToRoot' label='Move contents to root folder' />
116-
<Radio value='moveToFolder' label='Move contents to another folder' />
115+
<Radio value='root' label='Move contents to root folder' />
116+
<Radio value='folder' label='Move contents to another folder' />
117117
<Radio
118118
value='cascade'
119119
label={
@@ -125,7 +125,7 @@ export default function DeleteFolderModal({
125125
</Stack>
126126
</Radio.Group>
127127

128-
{childrenAction === 'moveToFolder' && (
128+
{childrenAction === 'folder' && (
129129
<Combobox
130130
store={combobox}
131131
withinPortal={true}
@@ -171,7 +171,8 @@ export default function DeleteFolderModal({
171171

172172
{childrenAction === 'cascade' && (
173173
<Text size='sm' c='red' fw={500}>
174-
Warning: This will permanently delete all subfolders and files within this folder.
174+
Warning: This will permanently delete all contents within this folder (subfolders will be
175+
deleted, and files will be unlinked from their folders).
175176
</Text>
176177
)}
177178
</>

0 commit comments

Comments
 (0)