Skip to content

Commit

Permalink
feat(v3.0.0): changed the example according to the dribble UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakxhit committed Dec 9, 2024
1 parent 9601a17 commit 0dfdf67
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 26 deletions.
36 changes: 15 additions & 21 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { useCallback, useMemo, useRef } from 'react';
import { StyleSheet, View, Text, Dimensions, FlatList } from 'react-native';
import { TabBar, type TabsType } from '@mindinventory/react-native-tab-bar-interaction';
import {
TabBar,
type TabsType,
} from '@mindinventory/react-native-tab-bar-interaction';
import LottieView from 'lottie-react-native';

const { width: screenWidth } = Dimensions.get('window');
Expand Down Expand Up @@ -55,22 +58,22 @@ interface TabsDataType extends TabsType {
const tabData: Array<TabsDataType> = [
{
name: 'Home',
activeTintColor: '#FFC0C7',
activeTintColor: '#61b769',
activeIcon: activeHome(true),
inactiveIcon: activeHome(false),
},
{
name: 'Cart',
activeTintColor: '#FF7128',
activeTintColor: '#bcc9d7',
activeIcon: activeList(true),
inactiveIcon: activeList(false),
},
{
name: 'Search',
activeTintColor: '#0088cc',
activeTintColor: '#546b7f',
activeIcon: activeSearch(true),
inactiveIcon: activeSearch(false),
},
},
];

export default function App() {
Expand Down Expand Up @@ -100,7 +103,7 @@ export default function App() {
},
]}
>
<Text>{item.name}</Text>
<Text style={styles.titleText}>{item.name}</Text>
</View>
);
}}
Expand All @@ -113,25 +116,16 @@ export default function App() {
<TabBar
tabs={tabs as Array<TabsType>}
onTabChange={onTabChange}
containerWidth={screenWidth - 30}
containerBottomSpace={30}
containerWidth={screenWidth - 30}
containerBottomSpace={30}
/>
</View>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
},
box: {
width: 60,
height: 60,
marginVertical: 20,
},
slide: {
width: screenWidth,
justifyContent: 'center',
alignItems: 'center',
},
container: { flex: 1 },
box: { width: 60, height: 60, marginVertical: 20 },
slide: { width: screenWidth, justifyContent: 'center', alignItems: 'center' },
titleText: { color: 'white' },
});
10 changes: 5 additions & 5 deletions src/TabBar/TabBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { TabItem } from './TabItem';
import AnimatedCircle from './AnimatedCircle';

const AnimatedPath = Animated.createAnimatedComponent(Path);
const TRANSITION_SPEED = 500;
const TRANSITION_SPEED = 300;
type GenerateSvgPath = (
position: number,
adjustedHeight: number,
Expand Down Expand Up @@ -101,10 +101,10 @@ export const TabBar = (props: TabBarProps) => {
tabBarContainerBackground,
circleFillColor,
containerBottomSpace,
containerTopRightRadius = 0,
containerTopLeftRadius = 0,
containerBottomLeftRadius = 0,
containerBottomRightRadius = 0,
containerTopRightRadius = 10,
containerTopLeftRadius = 10,
containerBottomLeftRadius = 25,
containerBottomRightRadius = 25,
defaultActiveTabIndex,
transitionSpeed,
} = props;
Expand Down

0 comments on commit 0dfdf67

Please sign in to comment.