@@ -34,6 +34,7 @@ import ActionStrip from '../../../components/mobile/ActionStrip';
34
34
import useAsModal from '../../../components/useAsModal' ;
35
35
import { PreferencesIcon } from '../../../common/icons' ;
36
36
import Dropdown from '../../../components/Dropdown' ;
37
+ import Sidebar from '../../../components/Sidebar' ;
37
38
38
39
const isUserOwner = ( { project, user } ) =>
39
40
project . owner && project . owner . id === user . id ;
@@ -67,18 +68,13 @@ const MobileIDEView = (props) => {
67
68
selectedFile, updateFileContent, files, user, params,
68
69
closeEditorOptions, showEditorOptions,
69
70
startRefreshSketch, stopSketch, expandSidebar, collapseSidebar, clearConsole, console,
70
- showRuntimeErrorWarning, hideRuntimeErrorWarning, startSketch, getProject, clearPersistedState
71
+ showRuntimeErrorWarning, hideRuntimeErrorWarning, startSketch, getProject, clearPersistedState, setUnsavedChanges
71
72
} = props ;
72
73
73
74
const [ tmController , setTmController ] = useState ( null ) ; // eslint-disable-line
74
75
75
76
const { username } = user ;
76
77
77
- const [ triggerNavDropdown , NavDropDown ] = useAsModal ( < Dropdown
78
- items = { getNatOptions ( username ) }
79
- align = "right"
80
- /> ) ;
81
-
82
78
// Force state reset
83
79
useEffect ( clearPersistedState , [ ] ) ;
84
80
useEffect ( stopSketch , [ ] ) ;
@@ -95,16 +91,34 @@ const MobileIDEView = (props) => {
95
91
setCurrentProjectID ( params . project_id ) ;
96
92
} , [ params , project , username ] ) ;
97
93
94
+ const [ toggleNavDropdown , NavDropDown ] = useAsModal ( < Dropdown
95
+ items = { getNatOptions ( username ) }
96
+ align = "right"
97
+ /> ) ;
98
+
99
+ const [ toggleExplorer , Explorer ] = useAsModal ( < Sidebar
100
+ title = "hahaha"
101
+ onPressClose = { ( ) => { } }
102
+ /> ) ;
103
+
104
+ // toggle sidebar starting opened
105
+ useEffect ( toggleExplorer , [ ] ) ;
98
106
99
107
return (
100
108
< Screen fullscreen >
109
+ < Explorer />
101
110
< Header
102
111
title = { project . name }
103
112
subtitle = { selectedFile . name }
104
113
>
105
114
< NavItem >
106
115
< IconButton
107
- onClick = { triggerNavDropdown }
116
+ onClick = { toggleExplorer }
117
+ icon = { MoreIcon }
118
+ aria-label = "Options"
119
+ />
120
+ < IconButton
121
+ onClick = { toggleNavDropdown }
108
122
icon = { MoreIcon }
109
123
aria-label = "Options"
110
124
/>
@@ -147,6 +161,7 @@ const MobileIDEView = (props) => {
147
161
hideRuntimeErrorWarning = { hideRuntimeErrorWarning }
148
162
runtimeErrorWarningVisible = { ide . runtimeErrorWarningVisible }
149
163
provideController = { setTmController }
164
+ setUnsavedChanges = { setUnsavedChanges }
150
165
/>
151
166
</ IDEWrapper >
152
167
@@ -267,6 +282,7 @@ MobileIDEView.propTypes = {
267
282
username : PropTypes . string ,
268
283
} ) . isRequired ,
269
284
285
+ setUnsavedChanges : PropTypes . func . isRequired ,
270
286
getProject : PropTypes . func . isRequired ,
271
287
clearPersistedState : PropTypes . func . isRequired ,
272
288
params : PropTypes . shape ( {
0 commit comments