From 5e438a33f94b64b7bd6b84eac15910810082f01f Mon Sep 17 00:00:00 2001 From: sarthakpranesh Date: Sat, 19 Dec 2020 20:56:21 +0530 Subject: [PATCH] Updated drawer navigation scaling & ready for new release Signed-off-by: sarthakpranesh --- src/components/navigation/Drawer.tsx | 6 ++++-- src/components/navigation/DrawerItem.tsx | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/navigation/Drawer.tsx b/src/components/navigation/Drawer.tsx index feb7a88..5b36af0 100644 --- a/src/components/navigation/Drawer.tsx +++ b/src/components/navigation/Drawer.tsx @@ -16,7 +16,9 @@ import TopHeadlinesScreen from '../../screens/TopHeadlinesScreen' // Importing drawer components import DrawerItem from './DrawerItem' -const scale = Dimensions.get('window').scale +// importing constants +import Layout from '../../Layout' +const scale = Layout.fontScale const Stack = createStackNavigator() @@ -47,7 +49,7 @@ export const Screens = ({ navigation, style, country }: ScreensProps) => { // eslint-disable-next-line react/prop-types onPress={() => navigation.openDrawer()} > - + ) }}> diff --git a/src/components/navigation/DrawerItem.tsx b/src/components/navigation/DrawerItem.tsx index e3ec4d8..87ce020 100644 --- a/src/components/navigation/DrawerItem.tsx +++ b/src/components/navigation/DrawerItem.tsx @@ -2,7 +2,9 @@ import React from 'react' import { TouchableOpacity, Text, Dimensions, StyleSheet, View } from 'react-native' import Icon from 'react-native-vector-icons/Feather' -const scale = Dimensions.get('window').scale +// importing constants +import Layout from '../../Layout' +const scale = Layout.fontScale export interface DrawerItemProps { label: string; @@ -15,7 +17,7 @@ const DrawerItem = ({ label, onPress, icon, style }: DrawerItemProps) => { return ( - + {label} @@ -38,7 +40,7 @@ const styles = StyleSheet.create({ }, drawerTextStyle: { paddingLeft: 4, - fontSize: 10 * scale, + fontSize: 18 * scale, fontWeight: 'bold' } })