Skip to content

Commit 597b9f1

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch PickButton to use useOvermind (codesandbox#2539)
1 parent 3b2ca3f commit 597b9f1

File tree

1 file changed

+32
-32
lines changed
  • packages/app/src/app/pages/Sandbox/Editor/Header/Buttons/PickButton

1 file changed

+32
-32
lines changed
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
import React from 'react';
2-
import { inject, hooksObserver } from 'app/componentConnectors';
1+
import React, { FunctionComponent } from 'react';
2+
3+
import { useOvermind } from 'app/overmind';
4+
35
import { Button } from './elements';
46

5-
export const PickButton = inject('store', 'signals')(
6-
hooksObserver(
7-
({
8-
signals: {
9-
explore: { pickSandboxModal },
7+
export const PickButton: FunctionComponent = () => {
8+
const {
9+
actions: {
10+
explore: { pickSandboxModal },
11+
},
12+
state: {
13+
editor: {
14+
currentSandbox: { id, title, description, owned },
1015
},
11-
store: {
12-
editor: {
13-
currentSandbox: { id, title, description, owned },
14-
},
15-
},
16-
}) => {
17-
const details = {
18-
id,
19-
title,
20-
description,
21-
};
16+
},
17+
} = useOvermind();
18+
19+
const details = {
20+
id,
21+
title,
22+
description,
23+
};
2224

23-
return (
24-
<Button
25-
onClick={() => {
26-
pickSandboxModal({ details });
27-
}}
28-
secondary={owned}
29-
small
30-
>
31-
Pick
32-
</Button>
33-
);
34-
}
35-
)
36-
);
25+
return (
26+
<Button
27+
onClick={() => {
28+
pickSandboxModal({ details });
29+
}}
30+
secondary={owned}
31+
small
32+
>
33+
Pick
34+
</Button>
35+
);
36+
};

0 commit comments

Comments
 (0)