From e7536289cbb4380dc82dcd70737e165727cbbb92 Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Wed, 9 Nov 2022 15:57:49 -0600
Subject: Add scene creator

---
 src/view/shell/mobile/MainMenu.tsx | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

(limited to 'src/view/shell/mobile/MainMenu.tsx')

diff --git a/src/view/shell/mobile/MainMenu.tsx b/src/view/shell/mobile/MainMenu.tsx
index 0249714f4..3bc045029 100644
--- a/src/view/shell/mobile/MainMenu.tsx
+++ b/src/view/shell/mobile/MainMenu.tsx
@@ -20,6 +20,7 @@ import _chunk from 'lodash.chunk'
 import {HomeIcon, UserGroupIcon, BellIcon} from '../../lib/icons'
 import {UserAvatar} from '../../com/util/UserAvatar'
 import {useStores} from '../../../state'
+import {CreateSceneModel} from '../../../state/models/shell-ui'
 import {s, colors} from '../../lib/styles'
 
 export const MainMenu = observer(
@@ -54,6 +55,10 @@ export const MainMenu = observer(
       store.nav.navigate(url)
       onClose()
     }
+    const onPressCreateScene = () => {
+      store.shell.openModal(new CreateSceneModel())
+      onClose()
+    }
 
     // rendering
     // =
@@ -65,17 +70,19 @@ export const MainMenu = observer(
     const MenuItem = ({
       icon,
       label,
-      url,
       count,
+      url,
+      onPress,
     }: {
       icon: IconProp
       label: string
-      url: string
       count?: number
+      url?: string
+      onPress?: () => void
     }) => (
       <TouchableOpacity
         style={[styles.menuItem, styles.menuItemMargin]}
-        onPress={() => onNavigate(url)}>
+        onPress={onPress ? onPress : () => onNavigate(url || '/')}>
         <View style={[styles.menuItemIconWrapper]}>
           {icon === 'home' ? (
             <HomeIcon style={styles.menuItemIcon} size="32" />
@@ -209,7 +216,7 @@ export const MainMenu = observer(
                 <MenuItem
                   icon={'user-group'}
                   label="Create Scene"
-                  url="/contacts"
+                  onPress={onPressCreateScene}
                 />
                 {store.me.memberships ? (
                   store.me.memberships.memberships.map((membership, i) => (
-- 
cgit 1.4.1

