Skip to content

Commit

Permalink
Updated drawer navigation scaling & ready for new release
Browse files Browse the repository at this point in the history
Signed-off-by: sarthakpranesh <sarthak.pranesh2018@vitstudent.ac.in>
  • Loading branch information
sarthakpranesh committed Dec 19, 2020
1 parent 3d18e51 commit 5e438a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/components/navigation/Drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -47,7 +49,7 @@ export const Screens = ({ navigation, style, country }: ScreensProps) => {
// eslint-disable-next-line react/prop-types
onPress={() => navigation.openDrawer()}
>
<Icon name="menu" size={12 * scale} color="black" />
<Icon name="menu" size={18 * scale} color="black" />
</TouchableOpacity>
)
}}>
Expand Down
8 changes: 5 additions & 3 deletions src/components/navigation/DrawerItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -15,7 +17,7 @@ const DrawerItem = ({ label, onPress, icon, style }: DrawerItemProps) => {
return (
<TouchableOpacity style={styles.drawerItemContainer} onPress={onPress}>
<View style={styles.innerDrawerItemContainer}>
<Icon name={icon} size={16 * scale} color="black" style={styles.drawerIconStyle} />
<Icon name={icon} size={18 * scale} color="black" style={styles.drawerIconStyle} />
<Text style={styles.drawerTextStyle}>{label}</Text>
</View>
</TouchableOpacity>
Expand All @@ -38,7 +40,7 @@ const styles = StyleSheet.create({
},
drawerTextStyle: {
paddingLeft: 4,
fontSize: 10 * scale,
fontSize: 18 * scale,
fontWeight: 'bold'
}
})
Expand Down

0 comments on commit 5e438a3

Please sign in to comment.