Skip to content

Commit dc3780d

Browse files
MichaelDeBoeySaraVieira
authored andcommitted
🔨 Switch PreferencesButton to use useOvermind (codesandbox#2542)
* 🔨 Switch PreferencesButton to use useOvermind * Fix types * Fix types
1 parent 41df3b2 commit dc3780d

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 SettingsIcon from 'react-icons/lib/md/settings';
3-
import { inject, hooksObserver } from 'app/componentConnectors';
3+
4+
import { useOvermind } from 'app/overmind';
5+
46
import { Action } from './Action';
57

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

0 commit comments

Comments
 (0)