@momo-kits/tab-view 0.103.1-beta.1 → 0.103.1-beta.3
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/package.json +16 -16
- package/tabItem/TabItem.tsx +10 -9
- package/types.ts +1 -1
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
2
|
+
"name": "@momo-kits/tab-view",
|
|
3
|
+
"version": "0.103.1-beta.3",
|
|
4
|
+
"private": false,
|
|
5
|
+
"main": "index.tsx",
|
|
6
|
+
"dependencies": {},
|
|
7
|
+
"peerDependencies": {
|
|
8
|
+
"@momo-kits/foundation": "latest",
|
|
9
|
+
"prop-types": "^15.7.2",
|
|
10
|
+
"react": "16.9.0",
|
|
11
|
+
"react-native": ">=0.55"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@momo-platform/versions": "4.1.11"
|
|
15
|
+
},
|
|
16
|
+
"license": "MoMo"
|
|
17
|
+
}
|
package/tabItem/TabItem.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, {FC} from 'react';
|
|
2
|
-
import {TouchableOpacity, View} from 'react-native';
|
|
3
|
-
import {TabItemProps} from '../types';
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { Platform, TouchableOpacity, View } from 'react-native';
|
|
3
|
+
import { TabItemProps } from '../types';
|
|
4
4
|
import {
|
|
5
5
|
Badge,
|
|
6
6
|
BadgeDot,
|
|
@@ -54,13 +54,13 @@ const TabItem: FC<TabItemProps> = ({
|
|
|
54
54
|
onPress={onPressTabItem}>
|
|
55
55
|
{renderIcon && typeof renderIcon === 'function' && (
|
|
56
56
|
<View
|
|
57
|
-
style={[styles.icon, styles.iconHolder, {marginRight: Spacing.S}]}>
|
|
57
|
+
style={[styles.icon, styles.iconHolder, { marginRight: Spacing.S }]}>
|
|
58
58
|
{renderIcon(active)}
|
|
59
59
|
</View>
|
|
60
60
|
)}
|
|
61
61
|
{!renderIcon && !!icon && (
|
|
62
62
|
<Icon
|
|
63
|
-
style={[styles.icon, {marginRight: Spacing.S}]}
|
|
63
|
+
style={[styles.icon, { marginRight: Spacing.S }]}
|
|
64
64
|
source={icon}
|
|
65
65
|
color={color}
|
|
66
66
|
/>
|
|
@@ -69,15 +69,15 @@ const TabItem: FC<TabItemProps> = ({
|
|
|
69
69
|
numberOfLines={1}
|
|
70
70
|
typography={typography}
|
|
71
71
|
color={color}
|
|
72
|
-
style={{flexShrink: 1}}>
|
|
72
|
+
style={{ flexShrink: 1 }}>
|
|
73
73
|
{title}
|
|
74
74
|
</Text>
|
|
75
75
|
{showDot && (
|
|
76
|
-
<BadgeDot size={dotSize} style={{marginLeft: Spacing.XS}} />
|
|
76
|
+
<BadgeDot size={dotSize} style={{ marginLeft: Spacing.XS }} />
|
|
77
77
|
)}
|
|
78
78
|
{!showDot && badgeValue && (
|
|
79
79
|
<View>
|
|
80
|
-
<Badge label={badgeValue} style={{marginLeft: Spacing.XS}} />
|
|
80
|
+
<Badge label={badgeValue} style={{ marginLeft: Spacing.XS }} />
|
|
81
81
|
</View>
|
|
82
82
|
)}
|
|
83
83
|
</TouchableOpacity>
|
|
@@ -98,6 +98,7 @@ const TabItem: FC<TabItemProps> = ({
|
|
|
98
98
|
paddingVertical: Spacing.M,
|
|
99
99
|
},
|
|
100
100
|
]}
|
|
101
|
+
accessible={Platform.OS !== "ios"}
|
|
101
102
|
onPress={onPressTabItem}
|
|
102
103
|
accessibilityLabel={accessibilityLabel}>
|
|
103
104
|
<View>
|
|
@@ -106,7 +107,7 @@ const TabItem: FC<TabItemProps> = ({
|
|
|
106
107
|
style={[
|
|
107
108
|
styles.icon,
|
|
108
109
|
styles.iconHolder,
|
|
109
|
-
{marginBottom: Spacing.XS},
|
|
110
|
+
{ marginBottom: Spacing.XS },
|
|
110
111
|
]}>
|
|
111
112
|
{renderIcon(active)}
|
|
112
113
|
</View>
|
package/types.ts
CHANGED
|
@@ -95,7 +95,7 @@ export type TabViewProps = {
|
|
|
95
95
|
/**
|
|
96
96
|
* Optional. Additional properties to pass to the underlying pager view component.
|
|
97
97
|
*/
|
|
98
|
-
pagerProps?: PagerViewProps
|
|
98
|
+
pagerProps?: Omit<PagerViewProps, 'children'>;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Optional. Specifies the layout direction for the tab's content, either in a row or column format.
|