diff --git a/front/components/navigators/TabRowNavigator.tsx b/front/components/navigators/TabRowNavigator.tsx index 40503bb..8c2d9d5 100644 --- a/front/components/navigators/TabRowNavigator.tsx +++ b/front/components/navigators/TabRowNavigator.tsx @@ -1,13 +1,6 @@ import * as React from "react"; -import { - View, - Text, - Pressable, - StyleProp, - ViewStyle, - StyleSheet, -} from "react-native"; -import { Box } from "native-base"; +import { StyleProp, ViewStyle, StyleSheet } from "react-native"; +import { View, Text, Pressable, Box, Row } from "native-base"; import { createNavigatorFactory, DefaultNavigatorOptions, @@ -74,50 +67,72 @@ function TabNavigator({ return ( - - - {state.routes.map((route) => ( - { - const event = navigation.emit({ - type: "tabPress", - target: route.key, - canPreventDefault: true, - data: { - isAlreadyFocused: route.key === state.routes[state.index].key, - }, - }); - - if (!event.defaultPrevented) { - navigation.dispatch({ - ...CommonActions.navigate(route), - target: state.key, - }); - } - }} - style={{ flex: 1 }} - > - {descriptors[route.key].options.title || route.name} - - ))} - - - {state.routes.map((route, i) => { - return ( - + + {state.routes.map((route) => ( + { + const event = navigation.emit({ + type: "tabPress", + target: route.key, + canPreventDefault: true, + data: { + isAlreadyFocused: + route.key === state.routes[state.index].key, + }, + }); + + if (!event.defaultPrevented) { + navigation.dispatch({ + ...CommonActions.navigate(route), + target: state.key, + }); + } + }} + style={{ flex: 1 }} > - {descriptors[route.key].render()} - - ); - })} - - + {({ isHovered, isPressed }) => ( + { + let colorLevel = 0; + if (isHovered) { + colorLevel += 100; + } + if (route.key === state.routes[state.index].key) { + colorLevel += 300; + } + if (isPressed) { + colorLevel += 200; + } + + if (colorLevel <= 0) { + return "transparent"; + } + return `primary.${colorLevel}`; + })()}> + + {descriptors[route.key].options.title || route.name} + + + )} + + ))} + + + {state.routes.map((route, i) => { + return ( + + {descriptors[route.key].render()} + + ); + })} + + ); } diff --git a/front/views/SettingsView.tsx b/front/views/SettingsView.tsx index 3de0c1e..d65b8be 100644 --- a/front/views/SettingsView.tsx +++ b/front/views/SettingsView.tsx @@ -257,7 +257,7 @@ const TabRow = createTabRowNavigator(); const SetttingsNavigator = () => { return ( - +