Skip to content

Commit cfa0866

Browse files
milap1296SaraVieira
andcommitted
🔨 Refactored, 🧠 Overmind, Hacktober | Refactor PreviewSetting… (#2758)
* Refactor|Overmind: Refactor PreviewSettings to use overmind * Adds myself in the contributor list Co-authored-by: Sara Vieira <[email protected]>
1 parent 167365c commit cfa0866

File tree

2 files changed

+7
-9
lines changed
  • packages/app/src/app/pages/common/Modals/PreferencesModal/EditorPageSettings/PreviewSettings

2 files changed

+7
-9
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ Thanks goes to these wonderful people
235235
</tr>
236236
<tr>
237237
<td align="center"><a href="http://hetpatel33.github.io"><img src="https://avatars0.githubusercontent.com/u/13877514?v=4" width="100px;" alt="Het Patel"/><br /><sub><b>Het Patel</b></sub></a><br /><a href="https://github.com/codesandbox/codesandbox-client/commits?author=hetpatel33" title="Code">💻</a></td>
238+
<td align="center"><a href="https://github.com/milap1296"><img src="https://avatars2.githubusercontent.com/u/19545730?v=4" width="100px;" alt="milap1296"/><br /><sub><b>milap1296</b></sub></a><br /><a href="https://github.com/codesandbox/codesandbox-client/commits?author=milap1296" title="Code">💻</a></td>
238239
<td align="center"><a href="https://github.com/Gobinath-Manokaran"><img src="https://avatars2.githubusercontent.com/u/6711914?v=4" width="100px;" alt="Gobinath-Manokaran"/><br /><sub><b>Gobinath-Manokaran</b></sub></a><br /><a href="https://github.com/codesandbox/codesandbox-client/commits?author=Gobinath-Manokaran" title="Code">💻</a></td>
239240
</tr>
240241
</table>
Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { inject, observer } from 'app/componentConnectors';
2+
import { useOvermind } from 'app/overmind';
33

44
import {
55
Title,
@@ -10,11 +10,12 @@ import {
1010
Rule,
1111
} from '../../elements';
1212

13-
function PreviewSettingsComponent({ store, signals }) {
13+
export const PreviewSettings: React.FC = () => {
14+
const { state, actions } = useOvermind();
1415
const bindValue = name => ({
15-
value: store.preferences.settings[name],
16+
value: state.preferences.settings[name],
1617
setValue: value =>
17-
signals.preferences.settingChanged({
18+
actions.preferences.settingChanged({
1819
name,
1920
value,
2021
}),
@@ -56,8 +57,4 @@ function PreviewSettingsComponent({ store, signals }) {
5657
</SubContainer>
5758
</div>
5859
);
59-
}
60-
61-
export const PreviewSettings = inject('store', 'signals')(
62-
observer(PreviewSettingsComponent)
63-
);
60+
};

0 commit comments

Comments
 (0)