11import React from 'react' ;
2- import { inject , observer } from 'app/componentConnectors ' ;
2+ import { useOvermind } from 'app/overmind ' ;
33import themes from '@codesandbox/common/lib/themes' ;
44
55import PreferenceText from '@codesandbox/common/lib/components/Preference/PreferenceText' ;
@@ -14,13 +14,20 @@ import {
1414import { BigTitle } from './elements' ;
1515import VSCodePlaceholder from '../VSCodePlaceholder' ;
1616
17- function EditorSettings ( { store, signals } ) {
18- const bindValue = ( name , setUndefined ) => ( {
19- value : setUndefined
20- ? store . preferences . settings [ name ] || undefined
21- : store . preferences . settings [ name ] ,
17+ export const Appearance : React . FC = ( ) => {
18+ const {
19+ state : {
20+ preferences : { settings } ,
21+ } ,
22+ actions : {
23+ preferences : { settingChanged } ,
24+ } ,
25+ } = useOvermind ( ) ;
26+
27+ const bindValue = ( name : string , setUndefined ?: boolean ) => ( {
28+ value : setUndefined ? settings [ name ] || undefined : settings [ name ] ,
2229 setValue : value =>
23- signals . preferences . settingChanged ( {
30+ settingChanged ( {
2431 name,
2532 value,
2633 } ) ,
@@ -60,7 +67,7 @@ function EditorSettings({ store, signals }) {
6067 </ a > { ' ' }
6168 as default font, you can also use locally installed fonts
6269 </ SubDescription >
63- { ! fontOptions . includes ( store . preferences . settings . fontFamily ) && (
70+ { ! fontOptions . includes ( settings . fontFamily ) && (
6471 < PreferenceText
6572 style = { { marginTop : '1rem' } }
6673 placeholder = "Enter your custom font"
@@ -105,7 +112,7 @@ function EditorSettings({ store, signals }) {
105112 </ SubDescription >
106113 </ VSCodePlaceholder >
107114
108- { store . preferences . settings . experimentVSCode ? (
115+ { settings . experimentVSCode ? (
109116 < div >
110117 < BigTitle > Editor Theme</ BigTitle >
111118 < SubDescription >
@@ -176,6 +183,4 @@ function EditorSettings({ store, signals }) {
176183 </ SubContainer >
177184 </ div >
178185 ) ;
179- }
180-
181- export const Appearance = inject ( 'store' , 'signals' ) ( observer ( EditorSettings ) ) ;
186+ } ;
0 commit comments