@momo-kits/foundation 0.92.3-tracking.5 → 0.92.3-tracking.7
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/Application/BottomTab/BottomTabBar.tsx +1 -2
- package/Application/BottomTab/index.tsx +2 -2
- package/Application/Components.tsx +9 -11
- package/Application/types.ts +1 -1
- package/Image/index.tsx +7 -10
- package/Popup/PopupNotify.tsx +2 -3
- package/Popup/PopupPromotion.tsx +2 -3
- package/package.json +1 -1
|
@@ -28,12 +28,12 @@ import {Radius} from '../../Consts';
|
|
|
28
28
|
import {Icon} from '../../Icon';
|
|
29
29
|
import {Text} from '../../Text';
|
|
30
30
|
import {FloatingButtonProps} from '../types';
|
|
31
|
-
import {getAccessibilityID} from '../utils';
|
|
32
31
|
|
|
33
32
|
type Props = BottomTabBarProps & {
|
|
34
33
|
activeTintColor?: string;
|
|
35
34
|
inactiveTintColor?: string;
|
|
36
35
|
floatingButton?: FloatingButtonProps;
|
|
36
|
+
accessibilityLabel?: string;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
type Options = {
|
|
@@ -317,7 +317,6 @@ export default function BottomTabBar({
|
|
|
317
317
|
labelStyle={labelStyle}
|
|
318
318
|
iconStyle={iconStyle}
|
|
319
319
|
style={tabStyle}
|
|
320
|
-
{...getAccessibilityID(`btn_tabbar_${route.name}`)}
|
|
321
320
|
/>
|
|
322
321
|
</NavigationRouteContext.Provider>
|
|
323
322
|
</NavigationContext.Provider>
|
|
@@ -9,7 +9,7 @@ import {Text} from '../../Text';
|
|
|
9
9
|
import {ApplicationContext} from '../index';
|
|
10
10
|
import StackScreen from '../StackScreen';
|
|
11
11
|
import {BottomTabProps, NavigationScreenProps} from '../types';
|
|
12
|
-
import {
|
|
12
|
+
import {getStackOptions} from '../utils';
|
|
13
13
|
import BottomTabBar from './BottomTabBar';
|
|
14
14
|
|
|
15
15
|
const Tab = createBottomTabNavigator();
|
|
@@ -67,8 +67,8 @@ const BottomTab: React.FC<BottomTabProps> = ({
|
|
|
67
67
|
backBehavior={'firstRoute'}
|
|
68
68
|
tabBar={props => (
|
|
69
69
|
<BottomTabBar
|
|
70
|
-
{...getAccessibilityID('tbr_main_bottom')}
|
|
71
70
|
{...props}
|
|
71
|
+
accessibilityLabel={'BottomTabBar'}
|
|
72
72
|
floatingButton={floatingButton}
|
|
73
73
|
/>
|
|
74
74
|
)}
|
|
@@ -29,7 +29,6 @@ import {scaleSize, Text} from '../Text';
|
|
|
29
29
|
import {Icon} from '../Icon';
|
|
30
30
|
import {PopupNotify} from '../Popup';
|
|
31
31
|
import {Badge, BadgeDot} from '../Badge';
|
|
32
|
-
import {getAccessibilityID} from './utils';
|
|
33
32
|
|
|
34
33
|
const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
35
34
|
icon,
|
|
@@ -38,7 +37,7 @@ const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
|
38
37
|
useBorder = true,
|
|
39
38
|
badgeType,
|
|
40
39
|
badgeValue,
|
|
41
|
-
|
|
40
|
+
accessibilityLabel = '',
|
|
42
41
|
}) => {
|
|
43
42
|
const {theme} = useContext(ApplicationContext);
|
|
44
43
|
let buttonStyle: ViewStyle = {backgroundColor: '#00000066'};
|
|
@@ -66,10 +65,9 @@ const NavigationButton: React.FC<NavigationButtonProps> = ({
|
|
|
66
65
|
}, [badgeType, badgeValue]);
|
|
67
66
|
|
|
68
67
|
return (
|
|
69
|
-
<View
|
|
70
|
-
{...getAccessibilityID(accessibilityID)}
|
|
71
|
-
style={{width: scaleSize(28)}}>
|
|
68
|
+
<View style={{width: scaleSize(28)}}>
|
|
72
69
|
<TouchableOpacity
|
|
70
|
+
accessibilityLabel={accessibilityLabel}
|
|
73
71
|
style={[styles.navigationButton, buttonStyle]}
|
|
74
72
|
onPress={onPress}>
|
|
75
73
|
<Icon
|
|
@@ -94,7 +92,7 @@ const HeaderTitle: React.FC<any> = props => {
|
|
|
94
92
|
return (
|
|
95
93
|
<Animated.Text
|
|
96
94
|
{...props}
|
|
97
|
-
{
|
|
95
|
+
accessibilityLabel={'title_navigation_header'}
|
|
98
96
|
style={[
|
|
99
97
|
styles.title,
|
|
100
98
|
{fontFamily: `${theme.font}-Bold`, opacity, color: props.tintColor},
|
|
@@ -173,7 +171,7 @@ const HeaderLeft: React.FC<HeaderBackProps> = ({
|
|
|
173
171
|
return (
|
|
174
172
|
<View style={styles.headerLeft}>
|
|
175
173
|
<NavigationButton
|
|
176
|
-
|
|
174
|
+
accessibilityLabel="btn_navigation_back"
|
|
177
175
|
icon="ic_back"
|
|
178
176
|
tintColor={tintColor}
|
|
179
177
|
onPress={goBackSafe}
|
|
@@ -248,7 +246,7 @@ const HeaderCustom: React.FC<TitleCustomProps> = ({
|
|
|
248
246
|
</View>
|
|
249
247
|
<View style={[Styles.flex, {paddingHorizontal: 8}]}>
|
|
250
248
|
<Text
|
|
251
|
-
{
|
|
249
|
+
accessibilityLabel={'title_navigation_header'}
|
|
252
250
|
typography="header_default_bold"
|
|
253
251
|
color={tintColor}>
|
|
254
252
|
{title}
|
|
@@ -376,7 +374,7 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
376
374
|
if (pinTool)
|
|
377
375
|
return (
|
|
378
376
|
<NavigationButton
|
|
379
|
-
|
|
377
|
+
accessibilityLabel="btn_navigation_pin"
|
|
380
378
|
icon={pinTool.icon as string}
|
|
381
379
|
tintColor={tintColor}
|
|
382
380
|
badgeValue={badgeValue}
|
|
@@ -407,13 +405,13 @@ const HeaderToolkitAction: React.FC<any> = ({
|
|
|
407
405
|
},
|
|
408
406
|
]}>
|
|
409
407
|
<TouchableOpacity
|
|
410
|
-
{
|
|
408
|
+
accessibilityLabel={'btn_navigation_more'}
|
|
411
409
|
onPress={onMore}>
|
|
412
410
|
<Icon color={tintColor} source="navigation_more_horiz" size={20} />
|
|
413
411
|
</TouchableOpacity>
|
|
414
412
|
<View style={[styles.divider, {backgroundColor: tintColor}]} />
|
|
415
413
|
<TouchableOpacity
|
|
416
|
-
{
|
|
414
|
+
accessibilityLabel={'btn_navigation_close'}
|
|
417
415
|
onPress={onClose}>
|
|
418
416
|
<Icon
|
|
419
417
|
color={tintColor}
|
package/Application/types.ts
CHANGED
package/Image/index.tsx
CHANGED
|
@@ -7,7 +7,6 @@ import {Skeleton} from '../Skeleton';
|
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
8
|
import {Styles} from '../Consts';
|
|
9
9
|
import {ImageProps} from './types';
|
|
10
|
-
import {getAccessibilityID} from '../Application/utils';
|
|
11
10
|
|
|
12
11
|
type Status = 'success' | 'loading' | 'error';
|
|
13
12
|
|
|
@@ -25,15 +24,13 @@ const Image: React.FC<ImageProps> = ({
|
|
|
25
24
|
const error = useRef(false);
|
|
26
25
|
const [status, setStatus] = useState<Status>('success');
|
|
27
26
|
|
|
28
|
-
const
|
|
29
|
-
`img|${(source as Source).uri}`,
|
|
30
|
-
|
|
31
|
-
);
|
|
27
|
+
const test: any = {
|
|
28
|
+
accessibilityLabel: accessibilityLabel || `img|${(source as Source).uri}`,
|
|
29
|
+
};
|
|
32
30
|
|
|
33
31
|
useEffect(() => {
|
|
34
|
-
component?.addChildren?.(
|
|
35
|
-
return () =>
|
|
36
|
-
component?.addChildren(id.testID || id.accessibilityLabel, 'remove');
|
|
32
|
+
component?.addChildren?.(test.accessibilityLabel, 'add');
|
|
33
|
+
return () => component?.addChildren(test.accessibilityLabel, 'remove');
|
|
37
34
|
}, []);
|
|
38
35
|
|
|
39
36
|
/**
|
|
@@ -62,11 +59,11 @@ const Image: React.FC<ImageProps> = ({
|
|
|
62
59
|
componentName: 'Image',
|
|
63
60
|
params,
|
|
64
61
|
state: loading ? 'loading' : 'loaded',
|
|
65
|
-
componentId: accessibilityLabel,
|
|
62
|
+
componentId: test.accessibilityLabel,
|
|
66
63
|
}}>
|
|
67
64
|
<FastImage
|
|
68
65
|
{...rest}
|
|
69
|
-
{...
|
|
66
|
+
{...test}
|
|
70
67
|
source={source}
|
|
71
68
|
style={[styles.container, style]}
|
|
72
69
|
onProgress={() => {
|
package/Popup/PopupNotify.tsx
CHANGED
|
@@ -7,7 +7,6 @@ import {Text} from '../Text';
|
|
|
7
7
|
import {ApplicationContext, MiniAppContext} from '../Application';
|
|
8
8
|
import {Button} from '../Button';
|
|
9
9
|
import {Icon} from '../Icon';
|
|
10
|
-
import {getAccessibilityID} from '../Application/utils';
|
|
11
10
|
|
|
12
11
|
const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
13
12
|
id,
|
|
@@ -163,7 +162,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
163
162
|
const buildCloseIcon = () => {
|
|
164
163
|
return (
|
|
165
164
|
<TouchableOpacity
|
|
166
|
-
{
|
|
165
|
+
accessibilityLabel={'ic_popup_close'}
|
|
167
166
|
style={styles.iconCloseContainer}
|
|
168
167
|
onPress={() => {
|
|
169
168
|
closeAction.current = 'icon_close';
|
|
@@ -189,7 +188,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
189
188
|
|
|
190
189
|
return (
|
|
191
190
|
<View
|
|
192
|
-
{
|
|
191
|
+
accessibilityLabel={'PopupNotify'}
|
|
193
192
|
style={[
|
|
194
193
|
styles.container,
|
|
195
194
|
{backgroundColor: theme.colors.background.surface},
|
package/Popup/PopupPromotion.tsx
CHANGED
|
@@ -5,7 +5,6 @@ import {ApplicationContext, MiniAppContext} from '../Application';
|
|
|
5
5
|
import {Image} from '../Image';
|
|
6
6
|
import {Radius, Spacing} from '../Consts';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
|
-
import {getAccessibilityID} from '../Application/utils';
|
|
9
8
|
|
|
10
9
|
const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
11
10
|
id,
|
|
@@ -53,7 +52,7 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
|
53
52
|
return (
|
|
54
53
|
<View style={styles.iconCloseContainer}>
|
|
55
54
|
<TouchableOpacity
|
|
56
|
-
{
|
|
55
|
+
accessibilityLabel={'ic_popup_close'}
|
|
57
56
|
onPress={() => {
|
|
58
57
|
closeAction.current = 'icon_close';
|
|
59
58
|
navigator?.pop();
|
|
@@ -80,7 +79,7 @@ const PopupPromotion: React.FC<PopupPromotionProps> = ({
|
|
|
80
79
|
};
|
|
81
80
|
|
|
82
81
|
return (
|
|
83
|
-
<View {
|
|
82
|
+
<View accessibilityLabel={'PopupPromotion'}>
|
|
84
83
|
<Image
|
|
85
84
|
source={{
|
|
86
85
|
uri: image,
|