Skip to content

Commit

Permalink
fix: BottomNavigation vertical align [issue](#1719) (#1721)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergey-kozel authored Apr 20, 2023
1 parent 3e155d8 commit 254f451
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,7 @@ export class BottomNavigation extends React.Component<BottomNavigationProps> {
const [indicatorElement, ...tabElements] = this.renderComponentChildren(evaStyle);

return (
<View
testID={testID}
style={styles.container}
>
<View testID={testID}>
{indicatorElement}
<View style={[evaStyle.container, styles.elementsContainer, style]}>
{tabElements}
Expand All @@ -211,9 +208,6 @@ export class BottomNavigation extends React.Component<BottomNavigationProps> {
}

const styles = StyleSheet.create({
container: {
flexGrow: 1,
},
elementsContainer: {
flexDirection: 'row',
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,44 @@
import React from 'react';
import { BottomNavigation, BottomNavigationTab } from '@ui-kitten/components';
import { BottomNavigation, BottomNavigationTab, Text } from '@ui-kitten/components';
import { StyleSheet, View } from 'react-native';

export const BottomNavigationSimpleUsageShowcase = (): React.ReactElement => {

const [selectedIndex, setSelectedIndex] = React.useState(0);

return (
<BottomNavigation
selectedIndex={selectedIndex}
onSelect={index => setSelectedIndex(index)}
>
<BottomNavigationTab title='USERS' />
<BottomNavigationTab title='ORDERS' />
<BottomNavigationTab title='TRANSACTIONS' />
</BottomNavigation>
<View style={styles.container}>
<View style={styles.contentContainer}>
<Text
category='h4'
style={styles.text}
>
Content
</Text>
</View>
<BottomNavigation
selectedIndex={selectedIndex}
onSelect={index => setSelectedIndex(index)}
>
<BottomNavigationTab title='USERS' />
<BottomNavigationTab title='ORDERS' />
<BottomNavigationTab title='TRANSACTIONS' />
</BottomNavigation>
</View>
);
};

const styles = StyleSheet.create({
container: {
height: 150,
backgroundColor: '#EEF1F6',
},
contentContainer: {
flex: 1,
justifyContent: 'center',
},
text: {
color: 'white',
textAlign: 'center',
},
});

0 comments on commit 254f451

Please sign in to comment.