@@ -13,7 +13,12 @@ import NavMenuItem from '../../../../components/Nav/NavMenuItem';
13
13
import { prop , remSize } from '../../../../theme' ;
14
14
import AsteriskIcon from '../../../../images/p5-asterisk.svg' ;
15
15
import IconButton from '../../../../components/mobile/IconButton' ;
16
- import { AccountIcon , EditorIcon , MoreIcon } from '../../../../common/icons' ;
16
+ import {
17
+ AccountIcon ,
18
+ AddIcon ,
19
+ EditorIcon ,
20
+ MoreIcon
21
+ } from '../../../../common/icons' ;
17
22
import {
18
23
newFile ,
19
24
newFolder ,
@@ -29,6 +34,7 @@ import { showToast } from '../../actions/toast';
29
34
import { setLanguage } from '../../actions/preferences' ;
30
35
import Overlay from '../../../App/components/Overlay' ;
31
36
import ProjectName from './ProjectName' ;
37
+ import CollectionCreate from '../../../User/components/CollectionCreate' ;
32
38
33
39
const Nav = styled ( NavBar ) `
34
40
background: ${ prop ( 'MobilePanel.default.background' ) } ;
@@ -238,6 +244,7 @@ const MobileNav = () => {
238
244
) }
239
245
</ Title >
240
246
< Options >
247
+ { title === 'My Stuff' && < StuffMenu /> }
241
248
{ user . authenticated ? (
242
249
< AccountMenu />
243
250
) : (
@@ -261,6 +268,40 @@ const MobileNav = () => {
261
268
) ;
262
269
} ;
263
270
271
+ const StuffMenu = ( ) => {
272
+ const dispatch = useDispatch ( ) ;
273
+ const { isOpen, handlers } = useMenuProps ( 'stuff' ) ;
274
+ const { newSketch } = useSketchActions ( ) ;
275
+
276
+ const [ createCollectionVisible , setCreateCollectionVisible ] = useState ( false ) ;
277
+
278
+ const { t } = useTranslation ( ) ;
279
+
280
+ return (
281
+ < div >
282
+ < IconButton icon = { AddIcon } { ...handlers } />
283
+ < ul className = { isOpen ? 'opened' : '' } >
284
+ < ParentMenuContext . Provider value = "stuff" >
285
+ < NavMenuItem onClick = { ( ) => newSketch ( ) } >
286
+ { t ( 'DashboardView.NewSketch' ) }
287
+ </ NavMenuItem >
288
+ < NavMenuItem onClick = { ( ) => setCreateCollectionVisible ( true ) } >
289
+ { t ( 'DashboardView.CreateCollection' ) }
290
+ </ NavMenuItem >
291
+ </ ParentMenuContext . Provider >
292
+ </ ul >
293
+ { createCollectionVisible && (
294
+ < Overlay
295
+ title = { t ( 'DashboardView.CreateCollectionOverlay' ) }
296
+ closeOverlay = { ( ) => setCreateCollectionVisible ( false ) }
297
+ >
298
+ < CollectionCreate />
299
+ </ Overlay >
300
+ ) }
301
+ </ div >
302
+ ) ;
303
+ } ;
304
+
264
305
const AccountMenu = ( ) => {
265
306
const user = useSelector ( ( state ) => state . user ) ;
266
307
const dispatch = useDispatch ( ) ;
0 commit comments