Fix sizing on smaller phones
This commit is contained in:
parent
fec1589f7c
commit
0b7b91d5fd
7 changed files with 32 additions and 21 deletions
|
@ -8,6 +8,7 @@ import {
|
|||
TouchableWithoutFeedback,
|
||||
View,
|
||||
} from 'react-native'
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||
import Animated, {
|
||||
useSharedValue,
|
||||
useAnimatedStyle,
|
||||
|
@ -27,6 +28,7 @@ export const MainMenu = observer(
|
|||
({active, onClose}: {active: boolean; onClose: () => void}) => {
|
||||
const store = useStores()
|
||||
const initInterp = useSharedValue<number>(0)
|
||||
const insets = useSafeAreaInsets()
|
||||
|
||||
useEffect(() => {
|
||||
if (active) {
|
||||
|
@ -167,7 +169,12 @@ export const MainMenu = observer(
|
|||
<TouchableWithoutFeedback onPress={onClose}>
|
||||
<View style={styles.bg} />
|
||||
</TouchableWithoutFeedback>
|
||||
<Animated.View style={[styles.wrapper, wrapperAnimStyle]}>
|
||||
<Animated.View
|
||||
style={[
|
||||
styles.wrapper,
|
||||
{bottom: insets.bottom + 55},
|
||||
wrapperAnimStyle,
|
||||
]}>
|
||||
<SafeAreaView>
|
||||
<View style={[styles.topSection]}>
|
||||
<TouchableOpacity
|
||||
|
@ -251,7 +258,6 @@ const styles = StyleSheet.create({
|
|||
wrapper: {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
bottom: 75,
|
||||
width: '100%',
|
||||
backgroundColor: '#fff',
|
||||
},
|
||||
|
|
|
@ -220,7 +220,7 @@ export const MobileShell: React.FC = observer(() => {
|
|||
</ScreenContainer>
|
||||
</GestureDetector>
|
||||
</SafeAreaView>
|
||||
<View style={styles.bottomBar}>
|
||||
<SafeAreaView style={styles.bottomBar}>
|
||||
<Btn icon="house" onPress={onPressHome} />
|
||||
<Btn icon="search" onPress={onPressSearch} />
|
||||
<Btn icon="menu" onPress={onPressMenu} />
|
||||
|
@ -230,7 +230,7 @@ export const MobileShell: React.FC = observer(() => {
|
|||
notificationCount={store.me.notificationCount}
|
||||
/>
|
||||
<Btn icon={['far', 'clone']} onPress={onPressTabs} />
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
<MainMenu
|
||||
active={isMainMenuActive}
|
||||
onClose={() => setMainMenuActive(false)}
|
||||
|
@ -373,7 +373,6 @@ const styles = StyleSheet.create({
|
|||
borderTopColor: colors.gray2,
|
||||
paddingLeft: 5,
|
||||
paddingRight: 15,
|
||||
paddingBottom: 20,
|
||||
},
|
||||
ctrl: {
|
||||
flex: 1,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue