diff --git a/bob_party/package.json b/bob_party/package.json index 33d8d8a..dc42f54 100644 --- a/bob_party/package.json +++ b/bob_party/package.json @@ -43,6 +43,7 @@ "react-native-gesture-handler": "~2.5.0", "react-native-picker-select": "^8.0.4", "react-native-safe-area-context": "4.3.1", + "react-native-status-bar-height": "^2.6.0", "react-native-web": "~0.18.7", "react-native-woodpicker": "^0.3.17", "react-redux": "^8.0.4", diff --git a/bob_party/src/components/TopBar.tsx b/bob_party/src/components/TopBar.tsx index 48bf5b1..6b609c2 100644 --- a/bob_party/src/components/TopBar.tsx +++ b/bob_party/src/components/TopBar.tsx @@ -1,5 +1,5 @@ import { FC, ReactNode } from "react" -import { Pressable, Image, Text, View} from "react-native" +import { Pressable, Image, Text, View, Platform} from "react-native" import { Skin } from "../core/Skin" import React from "react" import { SkinComponent } from "./SkinComponent" @@ -16,6 +16,27 @@ import { useConversationStore } from "../context/conversationContext" import { socket } from "../../socketConfig" import { Conversation } from "../core/conversation" import MatchModifier from "../core/Match/matchModifier" +import { getStatusBarHeight } from 'react-native-status-bar-height'; + +// 44 - on iPhoneX +// 20 - on iOS device +// X - on Android platfrom (runtime value) +// 0 - on all other platforms (default) + +function topBarTopDistance(){ + if(Platform.OS === 'ios'){ + return{ + paddingTop : getStatusBarHeight(), + paddingBottom : getStatusBarHeight()/2.5, + } + } + return{ + paddingTop : 20, + flex: 0.15, + } +} + + /* Images required @@ -85,7 +106,7 @@ FC<{nav: any, state?: string}> = switch (state) { case 'settings': return ( - + @@ -98,7 +119,7 @@ FC<{nav: any, state?: string}> = case 'matchmacking'|| 'game': return ( - + @@ -111,7 +132,7 @@ FC<{nav: any, state?: string}> = case 'conversation': return ( - + { resetCurrentConv(); MANAGER_CONVERSATION.setCurrentConv(null); nav.goBack()}}> @@ -123,7 +144,7 @@ FC<{nav: any, state?: string}> = ) case 'addConversation': return ( - + {nav.goBack()}}> @@ -136,7 +157,7 @@ FC<{nav: any, state?: string}> = default: return ( - + nav.navigate('ProfileTab', {screen: 'Profile'})}> @@ -147,4 +168,9 @@ FC<{nav: any, state?: string}> = ) } -} \ No newline at end of file +} + + +// { Platform.OS === 'ios' && ( +// +// )} \ No newline at end of file diff --git a/bob_party/src/components/style/TopBar.style.js b/bob_party/src/components/style/TopBar.style.js index e7e427a..8ef4d7f 100644 --- a/bob_party/src/components/style/TopBar.style.js +++ b/bob_party/src/components/style/TopBar.style.js @@ -6,7 +6,6 @@ import { StyleSheet } from 'react-native'; export default StyleSheet.create({ header: { - flex: 0.15, flexDirection: 'row', backgroundColor: '#2D2C33', width: '100%', @@ -32,4 +31,5 @@ export default StyleSheet.create({ letterSpacing: 0.25, color: 'white', }, -}); \ No newline at end of file +}); + diff --git a/bob_party/yarn.lock b/bob_party/yarn.lock index a2383cc..32b003d 100644 --- a/bob_party/yarn.lock +++ b/bob_party/yarn.lock @@ -7805,6 +7805,11 @@ react-native-safe-area-context@4.3.1: resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-4.3.1.tgz#5cf97b25b395e0d09bc1f828920cd7da0d792ade" integrity sha512-cEr7fknJCToTrSyDCVNg0GRdRMhyLeQa2NZwVCuzEQcWedOw/59ExomjmzCE4rxrKXs6OJbyfNtFRNyewDaHuA== +react-native-status-bar-height@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/react-native-status-bar-height/-/react-native-status-bar-height-2.6.0.tgz#b6afd25b6e3d533c43d0fcdcfd5cafd775592cea" + integrity sha512-z3SGLF0mHT+OlJDq7B7h/jXPjWcdBT3V14Le5L2PjntjjWM3+EJzq2BcXDwV+v67KFNJic5pgA26cCmseYek6w== + react-native-web@~0.18.7: version "0.18.10" resolved "https://registry.yarnpkg.com/react-native-web/-/react-native-web-0.18.10.tgz#fb4db047f4be7f9cf35f37ec8d52f7d1c450600f"