@orionarm/react-native-collapse-tabs 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20Android-blue?style=flat-square)]()
7
7
  [![types](https://img.shields.io/npm/types/@orionarm/react-native-collapse-tabs.svg?style=flat-square)](https://www.npmjs.com/package/@orionarm/react-native-collapse-tabs)
8
8
 
9
- > A high-performance **React Native collapsible tabs** component with **sticky / animated header**, **swipeable pages**, and **per-tab scroll state**. Built on [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view) and [`react-native-reanimated`](https://github.com/software-mansion/react-native-reanimated) v3.
9
+ > A high-performance **React Native collapsible tabs** component with **sticky / animated header**, **swipeable pages**, and **per-tab scroll state**. Built on [`react-native-pager-view`](https://github.com/callstack/react-native-pager-view) and [`react-native-reanimated`](https://github.com/software-mansion/react-native-reanimated).
10
10
 
11
11
  ## Preview
12
12
 
package/lib/TabBar.js CHANGED
@@ -17,15 +17,14 @@ const TabBarItem = ({ name, index, indexDecimal, onPress }) => {
17
17
  };
18
18
  const Indicator = ({ count, indexDecimal }) => {
19
19
  const style = useAnimatedStyle(() => ({
20
- transform: [
21
- { translateX: (indexDecimal.value * 100) / count + "%" },
22
- ],
20
+ transform: [{ translateX: indexDecimal.value * 100 + "%" }],
23
21
  width: `${100 / count}%`,
24
22
  }));
25
23
  return <Animated.View style={[styles.indicator, style]}/>;
26
24
  };
27
25
  const styles = StyleSheet.create({
28
26
  container: {
27
+ flex: 1,
29
28
  flexDirection: "row",
30
29
  backgroundColor: "#fff",
31
30
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orionarm/react-native-collapse-tabs",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "A high-performance React Native collapsible tabs component with sticky/animated header, swipeable pages, and per-tab scroll. Built on react-native-pager-view and react-native-reanimated v3.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/TabBar.tsx CHANGED
@@ -53,9 +53,7 @@ const Indicator: React.FC<{
53
53
  indexDecimal: Animated.SharedValue<number>;
54
54
  }> = ({ count, indexDecimal }) => {
55
55
  const style = useAnimatedStyle(() => ({
56
- transform: [
57
- { translateX: (indexDecimal.value * 100) / count + "%" } as any,
58
- ],
56
+ transform: [{ translateX: indexDecimal.value * 100 + "%" } as any],
59
57
  width: `${100 / count}%`,
60
58
  }));
61
59
  return <Animated.View style={[styles.indicator, style]} />;
@@ -63,6 +61,7 @@ const Indicator: React.FC<{
63
61
 
64
62
  const styles = StyleSheet.create({
65
63
  container: {
64
+ flex: 1,
66
65
  flexDirection: "row",
67
66
  backgroundColor: "#fff",
68
67
  },