diff --git a/ClientApp/.gitignore b/ClientApp/.gitignore index 388c39a66..7a80b24f8 100644 --- a/ClientApp/.gitignore +++ b/ClientApp/.gitignore @@ -13,7 +13,7 @@ web-build/ # macOS .DS_Store -package-lock.json +# package-lock.json # @generated expo-cli sync-2b81b286409207a5da26e14c78851eb30d8ccbdb # The following patterns were generated by expo-cli diff --git a/ClientApp/app/(tabs)/_layout.tsx b/ClientApp/app/(tabs)/_layout.tsx index dcfac5a2c..87aef044f 100644 --- a/ClientApp/app/(tabs)/_layout.tsx +++ b/ClientApp/app/(tabs)/_layout.tsx @@ -50,17 +50,18 @@ export default function TabLayout() { }} /> ( ), }} listeners={{ - tabPress: (e) => { - console.log('Chats tab pressed'); - }, + // tabPress: (e) => { + // console.log('Chats tab pressed'); + // }, }} /> { + const { id, title } = useLocalSearchParams(); + const router = useRouter(); + const [messages, setMessages] = useState([]); + const [finalToken, setFinalToken] = useState(""); + const user = useSelector((state: {user: any}) => state.user); + const [connected, setConnected] = useState(false); + const clientRef = useRef(null); + const avatarPlaceholder = require('@/assets/images/avatar-placeholder.png'); + + + const [chatroom, setChatroom] = useState(); + // TODO This will be a duplicate of the chatroom state + const [chatroomInformation, setChatroomInformation] = useState(); + + const navigation = useNavigation(); + const [infoVisible, setInfoVisible] = useState(false); + + const { t } = useTranslation(); + + // use effect to control the bottom tab bar visibility of the part "chat" + useEffect(() => { + // Hide tab bar when this screen is focused + const parent = navigation.getParent(); + parent?.setOptions({ + tabBarStyle: { + display: 'none' + } + }); + + // Restore it when unmounted + return () => { + parent?.setOptions({ + tabBarStyle: { + paddingHorizontal: 10, + height: mvs(65), + }, + }); + }; + }, []); + + useEffect(() => { + if (title && typeof title === 'string') { + navigation.setOptions({ + headerTitle: title, + headerRight: () => ( +