|
@@ -1,30 +1,39 @@
|
|
|
import React from 'react';
|
|
|
-import { View, Text } from 'react-native';
|
|
|
-import { TabView, TabBar, Route } from 'react-native-tab-view';
|
|
|
+import { Text, View } from 'react-native';
|
|
|
+import { Route, TabBar, TabView } from 'react-native-tab-view';
|
|
|
|
|
|
import { styles } from './styles';
|
|
|
import { Colors } from 'src/theme';
|
|
|
|
|
|
+import MarkToUpIcon from '../../../assets/icons/mark-to-up.svg';
|
|
|
+
|
|
|
export const HorizontalTabView = ({
|
|
|
index,
|
|
|
setIndex,
|
|
|
routes,
|
|
|
- renderScene
|
|
|
+ renderScene,
|
|
|
+ withMark
|
|
|
}: {
|
|
|
index: number;
|
|
|
setIndex: React.Dispatch<React.SetStateAction<number>>;
|
|
|
routes: Route[];
|
|
|
renderScene: (props: any) => React.ReactNode;
|
|
|
+ withMark?: boolean;
|
|
|
}) => {
|
|
|
-
|
|
|
const renderTabBar = (props: any) => (
|
|
|
<TabBar
|
|
|
{...props}
|
|
|
renderLabel={({ route, focused }) => (
|
|
|
<View style={[styles.tabLabelContainer, focused ? styles.tabLabelFocused : null]}>
|
|
|
- <Text style={[styles.label, focused ? styles.labelFocused : null]}>
|
|
|
- {route.title}
|
|
|
- </Text>
|
|
|
+ <Text style={[styles.label, focused ? styles.labelFocused : null]}>{route.title}</Text>
|
|
|
+ {withMark ? (
|
|
|
+ <MarkToUpIcon
|
|
|
+ height={16}
|
|
|
+ width={16}
|
|
|
+ style={styles.icon}
|
|
|
+ stroke={focused ? Colors.WHITE : Colors.DARK_BLUE}
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
</View>
|
|
|
)}
|
|
|
scrollEnabled={true}
|