@@ -2,6 +2,7 @@ import type { GetAllMyGroupsQuery } from "../../graphql/generated/graphql-types"
22import { useToggle } from "../../hooks/useToggle" ;
33import type { Message } from "../../types/Message" ;
44import { formatDate } from "../../utils/dateCalculator" ;
5+ import { useMobileNavigationStore } from "../../zustand/mobileNavigationStore" ;
56import GroupFormindex from "../forms/groups/index" ;
67import Button from "../utils/Button" ;
78import Card from "../utils/Card" ;
@@ -35,8 +36,16 @@ export default function Groups({
3536 onSuccess,
3637} : GroupsProps ) {
3738 const createGroupModal = useToggle ( false ) ;
39+ const { setBottomNavVisible } = useMobileNavigationStore ( ) ;
40+
41+ const openCreateGroupModal = ( ) => {
42+ createGroupModal . open ( ) ;
43+ setBottomNavVisible ( false ) ;
44+ } ;
45+
3846 const closeCreateGroupModal = ( ) => {
3947 createGroupModal . close ( ) ;
48+ setBottomNavVisible ( true ) ;
4049 } ;
4150
4251 return (
@@ -51,7 +60,7 @@ export default function Groups({
5160 icon = "plus"
5261 colour = "green"
5362 small
54- onClick = { createGroupModal . open }
63+ onClick = { openCreateGroupModal }
5564 />
5665 }
5766 >
@@ -93,9 +102,9 @@ export default function Groups({
93102 className = "p-0 overflow-y-auto max-h-[72vh] max-md:max-h-full"
94103 >
95104 < GroupFormindex
96- onCancel = { createGroupModal . close }
105+ onCancel = { closeCreateGroupModal }
97106 onSuccess = { ( ) => {
98- createGroupModal . close ( ) ;
107+ closeCreateGroupModal ( ) ;
99108 onSuccess ?.( ) ;
100109 } }
101110 />
0 commit comments