Skip to content

Commit

Permalink
chore: remove TabItem changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mastro993 committed Apr 9, 2024
1 parent 306a025 commit 396c457
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions src/components/tabs/TabItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useSpringPressProgressValue } from "../../utils/hooks/useSpringPressPro
import { WithTestID } from "../../utils/types";
import { IOIcons, Icon } from "../icons";
import { HSpacer } from "../spacer";
import { LabelSmallAlt } from "../typography";
import { LabelHeader } from "../typography/LabelHeader";

type ColorMode = "light" | "dark";

Expand Down Expand Up @@ -56,10 +56,6 @@ type ColorStates = {
selected: IOColors;
disabled: IOColors;
};
border: {
default: string;
selected: string;
};
};

const mapColorStates: Record<NonNullable<TabItem["color"]>, ColorStates> = {
Expand Down Expand Up @@ -118,10 +114,6 @@ const mapLegacyColorStates: Record<
default: "black",
selected: "blue",
disabled: "grey-700"
},
border: {
default: IOColors["grey-300"],
selected: IOColors["blueIO-500"]
}
},
dark: {
Expand All @@ -139,10 +131,6 @@ const mapLegacyColorStates: Record<
default: "white",
selected: "black",
disabled: "white"
},
border: {
default: "#ffffff00",
selected: "#ffffff00"
}
}
};
Expand Down Expand Up @@ -187,8 +175,6 @@ const TabItem = ({
[colors.border, selected, disabled]
);

const borderColor = colors.border?.[selected ? "selected" : "default"];

const opaquePressedBackgroundColor = hexToRgba(
colors.background.pressed,
0.1
Expand Down Expand Up @@ -261,8 +247,7 @@ const TabItem = ({
styles.container,
animatedStyle,
fullWidth && styles.fullWidth,
disabled && styles.disabled,
{ borderColor }
disabled && styles.disabled
]}
>
{activeIcon && (
Expand All @@ -271,7 +256,7 @@ const TabItem = ({
<HSpacer size={4} />
</>
)}
<LabelSmallAlt color={foregroundColor}>{label}</LabelSmallAlt>
<LabelHeader color={foregroundColor}>{label}</LabelHeader>
</Animated.View>
</Pressable>
);
Expand All @@ -287,13 +272,12 @@ const styles = StyleSheet.create({
borderRadius: 64,
borderCurve: "continuous",
justifyContent: "center",
alignSelf: "flex-start",
borderWidth: 1
alignSelf: "flex-start"
},
fullWidth: {
alignSelf: "auto"
},
disabled: { opacity: 0.3 }
disabled: { opacity: 0.5 }
});

export { TabItem };

0 comments on commit 396c457

Please sign in to comment.