Skip to content

Commit

Permalink
Refactor|Overmind: Refactor PreviewSettings to use overmind
Browse files Browse the repository at this point in the history
  • Loading branch information
milap1296 committed Oct 12, 2019
1 parent f7a25a3 commit 7e864b8
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { inject, observer } from 'app/componentConnectors';
import { useOvermind } from 'app/overmind';

import {
Title,
Expand All @@ -10,11 +10,12 @@ import {
Rule,
} from '../../elements';

function PreviewSettingsComponent({ store, signals }) {
export const PreviewSettings: React.FC = () => {
const { state, actions } = useOvermind();
const bindValue = name => ({
value: store.preferences.settings[name],
value: state.preferences.settings[name],
setValue: value =>
signals.preferences.settingChanged({
actions.preferences.settingChanged({
name,
value,
}),
Expand Down Expand Up @@ -56,8 +57,4 @@ function PreviewSettingsComponent({ store, signals }) {
</SubContainer>
</div>
);
}

export const PreviewSettings = inject('store', 'signals')(
observer(PreviewSettingsComponent)
);
};

0 comments on commit 7e864b8

Please sign in to comment.