@momo-kits/foundation 0.102.6-beta.5 → 0.102.6-beta.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/Components.tsx +1 -1
- package/Badge/BadgeDotAnimation.tsx +6 -33
- package/Badge/index.tsx +2 -1
- package/Badge/styles.ts +50 -6
- package/package.json +1 -1
|
@@ -35,7 +35,7 @@ import {Badge, BadgeDot} from '../Badge';
|
|
|
35
35
|
import {HeaderType} from '../Layout/types';
|
|
36
36
|
import Navigation from './Navigation';
|
|
37
37
|
import {InputRef, InputSearch, InputSearchProps} from '../Input';
|
|
38
|
-
import BadgeDotAnimation from '../Badge
|
|
38
|
+
import {BadgeDotAnimation} from '../Badge';
|
|
39
39
|
|
|
40
40
|
const SCREEN_PADDING = 12;
|
|
41
41
|
const BACK_WIDTH = 28;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, {useEffect, useRef} from 'react';
|
|
2
|
-
import {Animated,
|
|
2
|
+
import {Animated, View} from 'react-native';
|
|
3
3
|
import {BadgeDotProps} from './types';
|
|
4
|
-
import
|
|
4
|
+
import styles from './styles';
|
|
5
5
|
|
|
6
6
|
const DURATION = 500;
|
|
7
7
|
|
|
@@ -11,7 +11,8 @@ const BadgeDotAnimation = ({size, style}: BadgeDotProps) => {
|
|
|
11
11
|
const waveScaleAnim = useRef(new Animated.Value(1)).current;
|
|
12
12
|
const waveOpacityAnim = useRef(new Animated.Value(0)).current;
|
|
13
13
|
|
|
14
|
-
const dotStyle =
|
|
14
|
+
const dotStyle =
|
|
15
|
+
size === 'small' ? styles.dotAnimationSmall : styles.dotAnimation;
|
|
15
16
|
const waveStyle = size === 'small' ? styles.waveSmall : styles.wave;
|
|
16
17
|
|
|
17
18
|
useEffect(() => {
|
|
@@ -64,10 +65,10 @@ const BadgeDotAnimation = ({size, style}: BadgeDotProps) => {
|
|
|
64
65
|
return () => {
|
|
65
66
|
animation.stop();
|
|
66
67
|
};
|
|
67
|
-
}, [
|
|
68
|
+
}, []);
|
|
68
69
|
|
|
69
70
|
return (
|
|
70
|
-
<View style={[styles.
|
|
71
|
+
<View style={[styles.dotAnimationContainer, style]}>
|
|
71
72
|
{/* Wave Animation */}
|
|
72
73
|
<Animated.View
|
|
73
74
|
style={[
|
|
@@ -91,32 +92,4 @@ const BadgeDotAnimation = ({size, style}: BadgeDotProps) => {
|
|
|
91
92
|
);
|
|
92
93
|
};
|
|
93
94
|
|
|
94
|
-
const styles = StyleSheet.create({
|
|
95
|
-
...CommonStyle,
|
|
96
|
-
container: {
|
|
97
|
-
position: 'relative',
|
|
98
|
-
alignItems: 'center',
|
|
99
|
-
justifyContent: 'center',
|
|
100
|
-
},
|
|
101
|
-
dot: {
|
|
102
|
-
...CommonStyle.dot,
|
|
103
|
-
borderWidth: 0,
|
|
104
|
-
},
|
|
105
|
-
dotSmall: {
|
|
106
|
-
...CommonStyle.dotSmall,
|
|
107
|
-
borderWidth: 0,
|
|
108
|
-
},
|
|
109
|
-
wave: {
|
|
110
|
-
...CommonStyle.dot,
|
|
111
|
-
opacity: 0,
|
|
112
|
-
position: 'absolute',
|
|
113
|
-
borderWidth: 0,
|
|
114
|
-
},
|
|
115
|
-
waveSmall: {
|
|
116
|
-
...CommonStyle.dotSmall,
|
|
117
|
-
borderWidth: 0,
|
|
118
|
-
position: 'absolute',
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
|
|
122
95
|
export default BadgeDotAnimation;
|
package/Badge/index.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Badge from './Badge';
|
|
2
2
|
import BadgeDot from './BadgeDot';
|
|
3
3
|
import BadgeRibbon from './BadgeRibbon';
|
|
4
|
+
import BadgeDotAnimation from './BadgeDotAnimation';
|
|
4
5
|
import {BadgeProps, BadgeDotProps, BadgeRibbonProps} from './types';
|
|
5
6
|
|
|
6
|
-
export {Badge, BadgeRibbon, BadgeDot};
|
|
7
|
+
export {Badge, BadgeRibbon, BadgeDot, BadgeDotAnimation};
|
|
7
8
|
export type {BadgeProps, BadgeDotProps, BadgeRibbonProps};
|
package/Badge/styles.ts
CHANGED
|
@@ -2,6 +2,10 @@ import {StyleSheet} from 'react-native';
|
|
|
2
2
|
import {Colors, Radius, Spacing} from '../Consts';
|
|
3
3
|
import {scaleSize} from '../Text';
|
|
4
4
|
|
|
5
|
+
const DOT_SIZE = 16;
|
|
6
|
+
|
|
7
|
+
const DOT_SMALL_SIZE = 10;
|
|
8
|
+
|
|
5
9
|
export default StyleSheet.create({
|
|
6
10
|
badge: {
|
|
7
11
|
paddingHorizontal: Spacing.XS,
|
|
@@ -15,21 +19,61 @@ export default StyleSheet.create({
|
|
|
15
19
|
borderColor: Colors.black_01,
|
|
16
20
|
alignSelf: 'baseline',
|
|
17
21
|
},
|
|
22
|
+
dotAnimationContainer: {
|
|
23
|
+
position: 'relative',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
},
|
|
18
27
|
dot: {
|
|
19
|
-
width:
|
|
20
|
-
height:
|
|
28
|
+
width: DOT_SIZE,
|
|
29
|
+
height: DOT_SIZE,
|
|
21
30
|
borderWidth: 2,
|
|
22
31
|
borderColor: Colors.black_01,
|
|
23
32
|
backgroundColor: Colors.red_03,
|
|
24
|
-
borderRadius:
|
|
33
|
+
borderRadius: DOT_SIZE / 2,
|
|
25
34
|
},
|
|
26
35
|
dotSmall: {
|
|
27
|
-
width:
|
|
28
|
-
height:
|
|
36
|
+
width: DOT_SMALL_SIZE,
|
|
37
|
+
height: DOT_SMALL_SIZE,
|
|
29
38
|
borderWidth: 1,
|
|
30
39
|
borderColor: Colors.black_01,
|
|
31
40
|
backgroundColor: Colors.red_03,
|
|
32
|
-
borderRadius:
|
|
41
|
+
borderRadius: DOT_SMALL_SIZE / 2,
|
|
42
|
+
},
|
|
43
|
+
dotAnimation: {
|
|
44
|
+
width: DOT_SIZE,
|
|
45
|
+
height: DOT_SIZE,
|
|
46
|
+
borderColor: Colors.black_01,
|
|
47
|
+
backgroundColor: Colors.red_03,
|
|
48
|
+
borderRadius: DOT_SIZE / 2,
|
|
49
|
+
borderWidth: 0,
|
|
50
|
+
},
|
|
51
|
+
dotAnimationSmall: {
|
|
52
|
+
width: DOT_SMALL_SIZE,
|
|
53
|
+
height: DOT_SMALL_SIZE,
|
|
54
|
+
borderColor: Colors.black_01,
|
|
55
|
+
backgroundColor: Colors.red_03,
|
|
56
|
+
borderRadius: DOT_SMALL_SIZE / 2,
|
|
57
|
+
borderWidth: 0,
|
|
58
|
+
},
|
|
59
|
+
wave: {
|
|
60
|
+
width: DOT_SIZE,
|
|
61
|
+
height: DOT_SIZE,
|
|
62
|
+
borderColor: Colors.black_01,
|
|
63
|
+
backgroundColor: Colors.red_03,
|
|
64
|
+
borderRadius: DOT_SIZE / 2,
|
|
65
|
+
opacity: 0,
|
|
66
|
+
position: 'absolute',
|
|
67
|
+
borderWidth: 0,
|
|
68
|
+
},
|
|
69
|
+
waveSmall: {
|
|
70
|
+
width: DOT_SMALL_SIZE,
|
|
71
|
+
height: DOT_SMALL_SIZE,
|
|
72
|
+
borderColor: Colors.black_01,
|
|
73
|
+
backgroundColor: Colors.red_03,
|
|
74
|
+
borderRadius: DOT_SMALL_SIZE / 2,
|
|
75
|
+
borderWidth: 0,
|
|
76
|
+
position: 'absolute',
|
|
33
77
|
},
|
|
34
78
|
ribbon: {
|
|
35
79
|
alignSelf: 'baseline',
|