11import React from 'react' ;
2- import { inject , observer } from 'app/componentConnectors ' ;
2+ import { useOvermind } from 'app/overmind ' ;
33
44import {
55 Title ,
@@ -11,17 +11,24 @@ import {
1111} from '../../elements' ;
1212import VSCodePlaceholder from '../../VSCodePlaceholder' ;
1313
14- const isSafari = / ^ ( (? ! c h r o m e | a n d r o i d ) .) * s a f a r i / i. test ( navigator . userAgent ) ;
15- const isFF = navigator . userAgent . toLowerCase ( ) . includes ( 'firefox' ) ;
14+ const isSafari : boolean = / ^ ( (? ! c h r o m e | a n d r o i d ) .) * s a f a r i / i. test (
15+ navigator . userAgent
16+ ) ;
17+ const isFF : boolean = navigator . userAgent . toLowerCase ( ) . includes ( 'firefox' ) ;
18+
19+ export const EditorSettings : React . FC = ( ) => {
20+ const {
21+ state : {
22+ preferences : { settings } ,
23+ } ,
24+ actions : {
25+ preferences : { settingChanged } ,
26+ } ,
27+ } = useOvermind ( ) ;
1628
17- function EditorSettingsComponent ( { store, signals } ) {
18- const bindValue = name => ( {
19- value : store . preferences . settings [ name ] ,
20- setValue : value =>
21- signals . preferences . settingChanged ( {
22- name,
23- value,
24- } ) ,
29+ const bindValue = ( name : string ) => ( {
30+ value : settings [ name ] ,
31+ setValue : ( value : any ) => settingChanged ( { name, value } ) ,
2532 } ) ;
2633
2734 return (
@@ -97,8 +104,4 @@ function EditorSettingsComponent({ store, signals }) {
97104 </ SubContainer >
98105 </ div >
99106 ) ;
100- }
101-
102- export const EditorSettings = inject ( 'store' , 'signals' ) (
103- observer ( EditorSettingsComponent )
104- ) ;
107+ } ;
0 commit comments