@momo-kits/tab-view 0.92.21-beta.0 → 0.92.21-beta.2
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/index.tsx +2 -2
- package/package.json +2 -2
- package/publish.sh +6 -6
- package/tabBar/CardTabBar.tsx +1 -0
- package/tabItem/CardTabItem.tsx +3 -1
- package/tabItem/TabItem.tsx +4 -1
- package/types.ts +2 -0
package/index.tsx
CHANGED
|
@@ -25,7 +25,7 @@ const TabView: FC<TabViewProps> = ({
|
|
|
25
25
|
const [tabBarWidth, setTabBarWidth] = useState(0);
|
|
26
26
|
const isCardTab = type === 'card';
|
|
27
27
|
const pagerRef = useRef<PagerView>(null);
|
|
28
|
-
const scrollX = useRef(new Animated.Value(
|
|
28
|
+
const scrollX = useRef(new Animated.Value(startPage));
|
|
29
29
|
const lazy = useRef([selectedIndex]).current;
|
|
30
30
|
const {theme} = useContext(ApplicationContext);
|
|
31
31
|
const _onPressTabItem = (index: number) => {
|
|
@@ -66,7 +66,7 @@ const TabView: FC<TabViewProps> = ({
|
|
|
66
66
|
if (!lazy.includes(index)) return <View />;
|
|
67
67
|
return <View>{tab.component}</View>;
|
|
68
68
|
},
|
|
69
|
-
[tabs]
|
|
69
|
+
[tabs]
|
|
70
70
|
);
|
|
71
71
|
|
|
72
72
|
return (
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/tab-view",
|
|
3
|
-
"version": "0.92.21-beta.
|
|
3
|
+
"version": "0.92.21-beta.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.tsx",
|
|
6
6
|
"dependencies": {},
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
"@momo-platform/versions": "4.1.11"
|
|
15
15
|
},
|
|
16
16
|
"license": "MoMo"
|
|
17
|
-
}
|
|
17
|
+
}
|
package/publish.sh
CHANGED
|
@@ -7,16 +7,16 @@ rsync -r --exclude=/dist ./* dist
|
|
|
7
7
|
cd dist
|
|
8
8
|
|
|
9
9
|
if [ "$1" == "stable" ]; then
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
npm version $(npm view @momo-kits/tab-view@stable version)
|
|
11
|
+
npm version patch
|
|
12
12
|
npm publish --tag stable --access=public
|
|
13
13
|
elif [ "$1" == "latest" ]; then
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
npm version $(npm view @momo-kits/foundation@latest version)
|
|
15
|
+
npm version prerelease --preid=rc
|
|
16
16
|
npm publish --tag latest --access=public
|
|
17
17
|
else
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
npm version $(npm view @momo-kits/tab-view@beta version)
|
|
19
|
+
npm version prerelease --preid=beta
|
|
20
20
|
npm publish --tag beta --access=public
|
|
21
21
|
fi
|
|
22
22
|
|
package/tabBar/CardTabBar.tsx
CHANGED
package/tabItem/CardTabItem.tsx
CHANGED
|
@@ -19,13 +19,15 @@ const CardTabItem: FC<TabItemProps> = ({
|
|
|
19
19
|
showDot = false,
|
|
20
20
|
dotSize = 'small',
|
|
21
21
|
badgeValue,
|
|
22
|
+
accessibilityLabel,
|
|
22
23
|
} = tab;
|
|
23
24
|
const color = active ? selectedColor : unselectedColor;
|
|
24
25
|
|
|
25
26
|
return (
|
|
26
27
|
<TouchableOpacity
|
|
27
28
|
onPress={onPressTabItem}
|
|
28
|
-
style={[styles.cardTabItem, {width}]}
|
|
29
|
+
style={[styles.cardTabItem, {width}]}
|
|
30
|
+
accessibilityLabel={accessibilityLabel}>
|
|
29
31
|
{renderIcon &&
|
|
30
32
|
!['string', 'boolean', 'number'].includes(typeof renderIcon) && (
|
|
31
33
|
<View
|
package/tabItem/TabItem.tsx
CHANGED
|
@@ -28,6 +28,7 @@ const TabItem: FC<TabItemProps> = ({
|
|
|
28
28
|
dotSize = 'small',
|
|
29
29
|
badgeValue,
|
|
30
30
|
renderIcon,
|
|
31
|
+
accessibilityLabel,
|
|
31
32
|
} = tab;
|
|
32
33
|
const typography: Typography = active
|
|
33
34
|
? 'header_s_semibold'
|
|
@@ -38,6 +39,7 @@ const TabItem: FC<TabItemProps> = ({
|
|
|
38
39
|
const renderRowItem = () => {
|
|
39
40
|
return (
|
|
40
41
|
<TouchableOpacity
|
|
42
|
+
accessibilityLabel={accessibilityLabel}
|
|
41
43
|
style={[
|
|
42
44
|
styles.tabItem,
|
|
43
45
|
{
|
|
@@ -96,7 +98,8 @@ const TabItem: FC<TabItemProps> = ({
|
|
|
96
98
|
paddingVertical: Spacing.M,
|
|
97
99
|
},
|
|
98
100
|
]}
|
|
99
|
-
onPress={onPressTabItem}
|
|
101
|
+
onPress={onPressTabItem}
|
|
102
|
+
accessibilityLabel={accessibilityLabel}>
|
|
100
103
|
<View>
|
|
101
104
|
{renderIcon && typeof renderIcon === 'function' && (
|
|
102
105
|
<View
|