Skip to content

Commit 8e15e81

Browse files
refactor /app/pages/common/Modals/EmptyTrash/index.js to use Ov… (codesandbox#2795)
refactor /app/pages/common/Modals/EmptyTrash/index.js to use OverMind…
2 parents 2900686 + 7f9b95d commit 8e15e81

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed

packages/app/src/app/pages/common/Modals/EmptyTrash/index.js

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { Alert } from 'app/components/Alert';
2+
import { useOvermind } from 'app/overmind';
3+
import React, { FunctionComponent } from 'react';
4+
import { permanentlyDeleteSandboxes } from '../../../Dashboard/queries';
5+
6+
const EmptyTrash: FunctionComponent = () => {
7+
const {
8+
state: {
9+
dashboard: { trashSandboxIds },
10+
},
11+
actions: { modalClosed },
12+
} = useOvermind();
13+
return (
14+
<Alert
15+
title="Empty Trash"
16+
body="Are you sure you want to permanently delete all the sandboxes in the trash?"
17+
onCancel={() => modalClosed()}
18+
onConfirm={async () => {
19+
await permanentlyDeleteSandboxes(trashSandboxIds);
20+
modalClosed();
21+
}}
22+
/>
23+
);
24+
};
25+
26+
export default EmptyTrash;

0 commit comments

Comments
 (0)