diff --git a/ClientApp/.gitignore b/ClientApp/.gitignore index b3e4a1294..f5f129f40 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.json b/ClientApp/app.json index f3ede3e15..ecaeaff8e 100644 --- a/ClientApp/app.json +++ b/ClientApp/app.json @@ -1,4 +1,3 @@ - { "expo": { "name": "ClientApp", @@ -15,18 +14,20 @@ }, "ios": { "supportsTablet": true, - "googleServicesFile": "process.env.GOOGLE_SERVICE_INFO_PLIST ?? ./GoogleService-Info.plist", + "googleServicesFile": "./GoogleService-Info.plist", "bundleIdentifier": "com.nchelico.ClientApp", - "infoPlist": { - "ITSAppUsesNonExemptEncryption": false, - "NSCameraUsageDescription": "This app needs access to your camera to take photos.", - "NSMicrophoneUsageDescription": "This app needs access to your microphone for video recording.", - "NSPhotoLibraryUsageDescription": "This app needs access to your photo library to upload images.", - "NSPhotoLibraryAddUsageDescription": "This app needs permission to save photos to your gallery.", - "LSApplicationQueriesSchemes": [ - "myapp" - ], - "UIBackgroundModes": ["remote-notification"] + "infoPlist": { + "ITSAppUsesNonExemptEncryption": false, + "NSCameraUsageDescription": "This app needs access to your camera to take photos.", + "NSMicrophoneUsageDescription": "This app needs access to your microphone for video recording.", + "NSPhotoLibraryUsageDescription": "This app needs access to your photo library to upload images.", + "NSPhotoLibraryAddUsageDescription": "This app needs permission to save photos to your gallery.", + "LSApplicationQueriesSchemes": [ + "myapp" + ], + "UIBackgroundModes": [ + "remote-notification" + ] }, "config": { "googleMapsApiKey": "process.env.GOOGLE_MAPS_API_KEY" @@ -45,9 +46,9 @@ "android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION" ], - "googleServicesFile": "process.env.GOOGLE_SERVICES_JSON ?? ./google-services.json", + "googleServicesFile": "./google-services.json", "package": "com.sporta.clientApp", - "config" : { + "config": { "googleMaps": { "apiKey": "process.env.GOOGLE_MAPS_API_KEY" } @@ -90,6 +91,8 @@ "typedRoutes": true }, "extra": { + "apiBaseUrl": "https://api.sportahub.app/api/", + "googlePlacesApiKey": "process.env.GOOGLE_MAPS_API_KEY", "router": { "origin": false }, @@ -98,7 +101,7 @@ } }, "owner": "sportaapp", - "runtimeVersion": "1.0.0", + "runtimeVersion": "1.0.0", "updates": { "url": "https://u.expo.dev/0a493fac-f7b6-4eee-a154-9cc7280a3dad" } diff --git a/ClientApp/app/(tabs)/_layout.tsx b/ClientApp/app/(tabs)/_layout.tsx index 2650d4e25..5dc34a4c3 100644 --- a/ClientApp/app/(tabs)/_layout.tsx +++ b/ClientApp/app/(tabs)/_layout.tsx @@ -56,17 +56,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: () => ( +