From dbfb60a6a1d58c819db990e256888fc896511df3 Mon Sep 17 00:00:00 2001 From: Jakub Szymczak Date: Wed, 20 Dec 2023 18:10:13 +0100 Subject: [PATCH] fix pr comments --- src/components/TabSelector/TabIcon.tsx | 4 ++-- src/components/TabSelector/TabLabel.tsx | 2 +- src/components/TabSelector/TabSelector.tsx | 6 +++--- src/components/TabSelector/TabSelectorItem.tsx | 18 +++++++++--------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/components/TabSelector/TabIcon.tsx b/src/components/TabSelector/TabIcon.tsx index 5759e0505224..f61001145029 100644 --- a/src/components/TabSelector/TabIcon.tsx +++ b/src/components/TabSelector/TabIcon.tsx @@ -7,10 +7,10 @@ type TabIconProps = { /** Icon to display on tab */ icon?: (props: SrcProps) => React.ReactNode; - /** Animated opacity value while the label is inactive state */ + /** Animated opacity value while the icon is in inactive state */ inactiveOpacity?: number | Animated.AnimatedInterpolation; - /** Animated opacity value while the label is in active state */ + /** Animated opacity value while the icon is in active state */ activeOpacity?: number | Animated.AnimatedInterpolation; }; diff --git a/src/components/TabSelector/TabLabel.tsx b/src/components/TabSelector/TabLabel.tsx index 871d57b1d048..40f4dc30bb97 100644 --- a/src/components/TabSelector/TabLabel.tsx +++ b/src/components/TabSelector/TabLabel.tsx @@ -6,7 +6,7 @@ type TabLabelProps = { /** Title of the tab */ title?: string; - /** Animated opacity value while the label is inactive state */ + /** Animated opacity value while the label is in inactive state */ inactiveOpacity?: number | Animated.AnimatedInterpolation; /** Animated opacity value while the label is in active state */ diff --git a/src/components/TabSelector/TabSelector.tsx b/src/components/TabSelector/TabSelector.tsx index 77765fea8b4d..28ab15c04e9b 100644 --- a/src/components/TabSelector/TabSelector.tsx +++ b/src/components/TabSelector/TabSelector.tsx @@ -99,11 +99,11 @@ function TabSelector({state, navigation, onTabPress = () => {}, position}: TabSe const activeOpacity = getOpacity(position, state.routes.length, index, true, affectedAnimatedTabs); const inactiveOpacity = getOpacity(position, state.routes.length, index, false, affectedAnimatedTabs); const backgroundColor = getBackgroundColor(state.routes.length, index, affectedAnimatedTabs); - const isFocused = index === state.index; + const isActive = index === state.index; const {icon, title} = getIconAndTitle(route.name, translate); const onPress = () => { - if (isFocused) { + if (isActive) { return; } @@ -132,7 +132,7 @@ function TabSelector({state, navigation, onTabPress = () => {}, position}: TabSe activeOpacity={activeOpacity} inactiveOpacity={inactiveOpacity} backgroundColor={backgroundColor} - isFocused={isFocused} + isActive={isActive} /> ); })} diff --git a/src/components/TabSelector/TabSelectorItem.tsx b/src/components/TabSelector/TabSelectorItem.tsx index 9f679ab020ae..c10a7475504f 100644 --- a/src/components/TabSelector/TabSelectorItem.tsx +++ b/src/components/TabSelector/TabSelectorItem.tsx @@ -19,17 +19,17 @@ type TabSelectorItemProps = { /** Animated background color value for the tab button */ backgroundColor?: string | Animated.AnimatedInterpolation; - /** Animated opacity value while the label is inactive state */ + /** Animated opacity value while the tab is in inactive state */ inactiveOpacity?: number | Animated.AnimatedInterpolation; - /** Animated opacity value while the label is in active state */ + /** Animated opacity value while the tab is in active state */ activeOpacity?: number | Animated.AnimatedInterpolation; /** Whether this tab is active */ - isFocused?: boolean; + isActive?: boolean; }; -function TabSelectorItem({icon, title = '', onPress = () => {}, backgroundColor = '', activeOpacity = 0, inactiveOpacity = 1, isFocused = false}: TabSelectorItemProps) { +function TabSelectorItem({icon, title = '', onPress = () => {}, backgroundColor = '', activeOpacity = 0, inactiveOpacity = 1, isActive = false}: TabSelectorItemProps) { const styles = useThemeStyles(); return ( {}, backgroundColor onPress={onPress} > {({hovered}) => ( - + )}