Skip to content

Commit

Permalink
fix(INJI-427):refactor bottomTabBar styles into theme files
Browse files Browse the repository at this point in the history
Signed-off-by: Sri Kanth Kola <[email protected]>
  • Loading branch information
srikanth716 committed Oct 30, 2023
1 parent 2c9aba9 commit 8505f15
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 27 deletions.
17 changes: 17 additions & 0 deletions components/ui/themes/DefaultTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,23 @@ export const DefaultTheme = {
maxHeight: Dimensions.get('window').height,
},
}),
BottomTabBarStyle: StyleSheet.create({
headerRightContainerStyle: {paddingEnd: 13},
headerLeftContainerStyle: {paddingEnd: 13},
tabBarLabelStyle: {
fontSize: 12,
fontFamily: 'Inter_600SemiBold',
},
tabBarStyle: {
display: 'flex',
height: 75,
paddingHorizontal: 10,
},
tabBarItemStyle: {
height: 83,
padding: 11,
},
}),

ICON_SMALL_SIZE: 16,
ICON_MID_SIZE: 22,
Expand Down
17 changes: 17 additions & 0 deletions components/ui/themes/PurpleTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,23 @@ export const PurpleTheme = {
maxHeight: Dimensions.get('window').height,
},
}),
BottomTabBarStyle: StyleSheet.create({
headerRightContainerStyle: {paddingEnd: 13},
headerLeftContainerStyle: {paddingEnd: 13},
tabBarLabelStyle: {
fontSize: 12,
fontFamily: 'Inter_600SemiBold',
},
tabBarStyle: {
display: 'flex',
height: 75,
paddingHorizontal: 10,
},
tabBarItemStyle: {
height: 83,
padding: 11,
},
}),

ICON_SMALL_SIZE: 16,
ICON_MID_SIZE: 22,
Expand Down
10 changes: 2 additions & 8 deletions routes/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@ import {HistoryScreen} from '../screens/History/HistoryScreen';
import i18n from '../i18n';
import {BOTTOM_TAB_ROUTES} from './routesConstants';
import {HomeScreenLayout} from '../screens/HomeScreenLayout';

let tabBarVisible = {
display: 'flex',
height: 75,
paddingHorizontal: 10,
};
import {Theme} from '../components/ui/styleUtils';

export const changeTabBarVisible = (visible: string) => {
tabBarVisible.display = visible;
Theme.BottomTabBarStyle.tabBarStyle.display = visible;
};

const home: TabScreen = {
Expand All @@ -36,7 +31,6 @@ export const scan: TabScreen = {
options: {
title: i18n.t('MainLayout:scan'),
headerShown: false,
tabBarStyle: tabBarVisible,
},
};

Expand Down
20 changes: 1 addition & 19 deletions screens/MainLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,9 @@ export const MainLayout: React.FC<
/>
</Row>
),
headerTitleStyle: {
fontFamily: 'Inter_600SemiBold',
fontSize: 30,
margin: 4,
},
headerRightContainerStyle: {paddingEnd: 13},
headerLeftContainerStyle: {paddingEnd: 13},
tabBarShowLabel: true,
tabBarActiveTintColor: Theme.Colors.IconBg,
tabBarLabelStyle: {
fontSize: 12,
fontFamily: 'Inter_600SemiBold',
},
tabBarStyle: {
height: 75,
paddingHorizontal: 10,
},
tabBarItemStyle: {
height: 83,
padding: 11,
},
...Theme.BottomTabBarStyle,
};

return (
Expand Down

0 comments on commit 8505f15

Please sign in to comment.