Skip to content

Commit 41df3b2

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch NewSandboxButton to use useOvermind (codesandbox#2541)
* 🔨 Switch NewSandboxButton to use useOvermind * Fix types * Fix types
1 parent 6a5850a commit 41df3b2

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed
Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
import React from 'react';
1+
import React, { FunctionComponent } from 'react';
22
import PlusIcon from 'react-icons/lib/go/plus';
3-
import { inject, hooksObserver } from 'app/componentConnectors';
3+
4+
import { useOvermind } from 'app/overmind';
5+
46
import { Action } from './Action';
57

6-
export const NewSandboxButton = inject('signals')(
7-
hooksObserver(({ signals: { modalOpened } }) => (
8+
export const NewSandboxButton: FunctionComponent = () => {
9+
const {
10+
actions: { modalOpened },
11+
} = useOvermind();
12+
13+
return (
814
<Action
15+
Icon={PlusIcon}
916
onClick={() => modalOpened({ modal: 'newSandbox' })}
1017
tooltip="New Sandbox"
11-
Icon={PlusIcon}
1218
/>
13-
))
14-
);
19+
);
20+
};

0 commit comments

Comments
 (0)