@@ -4,7 +4,7 @@ import getUI from '@codesandbox/common/lib/templates/configuration/ui';
44import { Module , Configuration } from '@codesandbox/common/lib/types' ;
55import { resolveModule } from '@codesandbox/common/lib/sandbox/modules' ;
66
7- import { inject , observer } from 'app/componentConnectors ' ;
7+ import { useOvermind } from 'app/overmind ' ;
88
99import BookIcon from 'react-icons/lib/md/library-books' ;
1010import UIIcon from 'react-icons/lib/md/dvr' ;
@@ -21,12 +21,13 @@ import {
2121} from './elements' ;
2222
2323type FileConfigProps = {
24- path : string ,
24+ path : string ;
2525 info : {
26- module ?: Module ,
27- config : Configuration ,
28- } ,
29- createModule : ( title : string ) => void ,
26+ module ?: Module ;
27+ config : Configuration ;
28+ } ;
29+ createModule ?: ( title : string ) => void ;
30+ openModule ?: ( id : string ) => void ;
3031} ;
3132
3233const FileConfig = ( {
@@ -82,8 +83,13 @@ const FileConfig = ({
8283 ) ;
8384} ;
8485
85- const ConfigurationFiles = ( { store, signals } ) => {
86- const sandbox = store . editor . currentSandbox ;
86+ const ConfigurationFiles = ( ) => {
87+ const {
88+ state,
89+ actions : { files, editor } ,
90+ } = useOvermind ( ) ;
91+
92+ const sandbox = state . editor . currentSandbox ;
8793 const { configurationFiles } = getDefinition ( sandbox . template ) ;
8894
8995 const createdPaths = { } ;
@@ -123,7 +129,7 @@ const ConfigurationFiles = ({ store, signals }) => {
123129 < FileConfig
124130 key = { path }
125131 openModule = { id => {
126- signals . editor . moduleSelected ( { id } ) ;
132+ editor . moduleSelected ( { id } ) ;
127133 } }
128134 path = { path }
129135 info = { info }
@@ -140,7 +146,7 @@ const ConfigurationFiles = ({ store, signals }) => {
140146 < FileConfig
141147 key = { path }
142148 createModule = { title => {
143- signals . files . moduleCreated ( { title } ) ;
149+ files . moduleCreated ( { title, directoryShortid : null } ) ;
144150 } }
145151 path = { path }
146152 info = { info }
@@ -152,4 +158,4 @@ const ConfigurationFiles = ({ store, signals }) => {
152158 ) ;
153159} ;
154160
155- export default inject ( 'signals' , 'store' ) ( observer ( ConfigurationFiles ) ) ;
161+ export default ConfigurationFiles ;
0 commit comments