@momo-kits/foundation 1.0.14 → 1.0.15
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/Input/InputSearch.tsx +2 -3
- package/Input/common.tsx +2 -3
- package/Input/index.tsx +0 -1
- package/Layout/ScreenContainer.tsx +2 -2
- package/Navigation/Components.tsx +8 -5
- package/Navigation/types.ts +1 -0
- package/Popup/PopupNotify.tsx +5 -5
- package/Skeleton/index.tsx +1 -2
- package/package.json +1 -1
package/Input/InputSearch.tsx
CHANGED
|
@@ -22,7 +22,6 @@ const InputSearch: FC<InputSearchProps> = ({
|
|
|
22
22
|
icon,
|
|
23
23
|
buttonText = 'Hủy',
|
|
24
24
|
showButtonText = true,
|
|
25
|
-
showIcon = true,
|
|
26
25
|
showBorder = true,
|
|
27
26
|
style,
|
|
28
27
|
...props
|
|
@@ -104,7 +103,7 @@ const InputSearch: FC<InputSearchProps> = ({
|
|
|
104
103
|
/>
|
|
105
104
|
</TouchableOpacity>
|
|
106
105
|
)}
|
|
107
|
-
{
|
|
106
|
+
{icon || (
|
|
108
107
|
<View style={{flexDirection: 'row'}}>
|
|
109
108
|
<View
|
|
110
109
|
style={[
|
|
@@ -116,7 +115,7 @@ const InputSearch: FC<InputSearchProps> = ({
|
|
|
116
115
|
/>
|
|
117
116
|
<Icon
|
|
118
117
|
color={iconTintColor}
|
|
119
|
-
source={icon}
|
|
118
|
+
source={icon as string}
|
|
120
119
|
style={styles.iconSearchInput}
|
|
121
120
|
/>
|
|
122
121
|
</View>
|
package/Input/common.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {View} from 'react-native';
|
|
2
2
|
import styles from './styles';
|
|
3
3
|
import {Text} from '../Text';
|
|
4
|
-
import {Image} from '../Image';
|
|
5
4
|
import React, {FC, useContext} from 'react';
|
|
6
5
|
import {ApplicationContext} from '../Navigation';
|
|
7
6
|
import {Icon} from '../Icon';
|
|
@@ -99,10 +98,10 @@ export const FloatingView: FC<FloatingViewProps> = ({
|
|
|
99
98
|
</Text>
|
|
100
99
|
)}
|
|
101
100
|
</Text>
|
|
102
|
-
{floatingIcon
|
|
101
|
+
{floatingIcon || (
|
|
103
102
|
<Icon
|
|
104
103
|
color={floatingIconTintColor}
|
|
105
|
-
source={floatingIcon}
|
|
104
|
+
source={floatingIcon as string}
|
|
106
105
|
size={16}
|
|
107
106
|
style={styles.floatingIcon}
|
|
108
107
|
/>
|
package/Input/index.tsx
CHANGED
|
@@ -30,7 +30,7 @@ const ScreenContainer: React.FC<ScreenContainerProps> = ({
|
|
|
30
30
|
transform: [
|
|
31
31
|
{
|
|
32
32
|
scale: scrollY.interpolate?.({
|
|
33
|
-
inputRange: [-300,
|
|
33
|
+
inputRange: [-300, 0, 1],
|
|
34
34
|
outputRange: [1.75, 1, 1],
|
|
35
35
|
extrapolate: 'clamp',
|
|
36
36
|
}),
|
|
@@ -76,7 +76,7 @@ const ScreenContainer: React.FC<ScreenContainerProps> = ({
|
|
|
76
76
|
height: 300,
|
|
77
77
|
width: '100%',
|
|
78
78
|
}}>
|
|
79
|
-
{headerBackground
|
|
79
|
+
{headerBackground || (
|
|
80
80
|
<Animated.Image
|
|
81
81
|
source={{
|
|
82
82
|
uri: headerBackground,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
View,
|
|
9
9
|
} from 'react-native';
|
|
10
10
|
import {ApplicationContext, NavigationButton} from './index';
|
|
11
|
-
import {Colors, Spacing, Styles} from '../Consts';
|
|
11
|
+
import {Colors, Radius, Spacing, Styles} from '../Consts';
|
|
12
12
|
import {Image} from '../Image';
|
|
13
13
|
import {HeaderBackgroundProps, TitleCustomProps} from './types';
|
|
14
14
|
import {Text} from '../Text';
|
|
@@ -26,7 +26,8 @@ const styles = StyleSheet.create({
|
|
|
26
26
|
justifyContent: 'center',
|
|
27
27
|
width: '100%',
|
|
28
28
|
},
|
|
29
|
-
|
|
29
|
+
circle: {width: 36, height: 36, borderRadius: 18},
|
|
30
|
+
square: {width: 36, height: 36, borderRadius: Radius.XS},
|
|
30
31
|
dotAvatar: {
|
|
31
32
|
position: 'absolute',
|
|
32
33
|
width: 12,
|
|
@@ -138,7 +139,7 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
|
|
|
138
139
|
<StatusBar
|
|
139
140
|
barStyle={headerImage || theme.dark ? 'light-content' : 'dark-content'}
|
|
140
141
|
/>
|
|
141
|
-
{headerImage
|
|
142
|
+
{headerImage || (
|
|
142
143
|
<Image style={styles.headerBackground} source={{uri: headerImage}} />
|
|
143
144
|
)}
|
|
144
145
|
</Animated.View>
|
|
@@ -149,15 +150,17 @@ const HeaderCustom: React.FC<TitleCustomProps> = ({
|
|
|
149
150
|
title,
|
|
150
151
|
subTitle,
|
|
151
152
|
image,
|
|
153
|
+
imageShape = 'circle',
|
|
152
154
|
content,
|
|
153
155
|
tintColor,
|
|
154
156
|
dotColor,
|
|
155
157
|
}) => {
|
|
158
|
+
const avatarStyle = imageShape == 'circle' ? styles.square : styles.square;
|
|
156
159
|
const header = (
|
|
157
160
|
<View style={Styles.row}>
|
|
158
161
|
<View>
|
|
159
|
-
<Image source={{uri: image}} style={
|
|
160
|
-
{dotColor
|
|
162
|
+
<Image source={{uri: image}} style={avatarStyle} />
|
|
163
|
+
{dotColor || (
|
|
161
164
|
<View style={[styles.dotAvatar, {backgroundColor: dotColor}]} />
|
|
162
165
|
)}
|
|
163
166
|
</View>
|
package/Navigation/types.ts
CHANGED
package/Popup/PopupNotify.tsx
CHANGED
|
@@ -36,11 +36,11 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
36
36
|
const renderRow = () => {
|
|
37
37
|
return (
|
|
38
38
|
<View style={Styles.row}>
|
|
39
|
-
{secondary?.title
|
|
39
|
+
{secondary?.title || (
|
|
40
40
|
<>
|
|
41
41
|
<View style={Styles.flex}>
|
|
42
42
|
<Button
|
|
43
|
-
title={secondary
|
|
43
|
+
title={secondary?.title as string}
|
|
44
44
|
type="text"
|
|
45
45
|
size="medium"
|
|
46
46
|
onPress={() => {
|
|
@@ -73,11 +73,11 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
73
73
|
onAction(primary.onPress);
|
|
74
74
|
}}
|
|
75
75
|
/>
|
|
76
|
-
{secondary?.title
|
|
76
|
+
{secondary?.title || (
|
|
77
77
|
<>
|
|
78
78
|
<View style={styles.buttonSpace} />
|
|
79
79
|
<Button
|
|
80
|
-
title={secondary
|
|
80
|
+
title={secondary?.title as string}
|
|
81
81
|
type="text"
|
|
82
82
|
size="medium"
|
|
83
83
|
onPress={() => {
|
|
@@ -147,7 +147,7 @@ const PopupNotify: React.FC<PopupNotifyProps> = ({
|
|
|
147
147
|
{description}
|
|
148
148
|
</Text>
|
|
149
149
|
</View>
|
|
150
|
-
{information
|
|
150
|
+
{information || (
|
|
151
151
|
<View style={styles.information}>
|
|
152
152
|
<Text
|
|
153
153
|
typography={'description_xs'}
|
package/Skeleton/index.tsx
CHANGED
|
@@ -2,9 +2,8 @@ import React, {useEffect, useMemo, useRef, useState} from 'react';
|
|
|
2
2
|
import {Animated, Easing, Platform, StyleSheet, View} from 'react-native';
|
|
3
3
|
import LinearGradient from 'react-native-linear-gradient';
|
|
4
4
|
import {SkeletonTypes} from './types';
|
|
5
|
-
import {Styles} from '../Consts';
|
|
5
|
+
import {Colors, Styles} from '../Consts';
|
|
6
6
|
import styles from './styles';
|
|
7
|
-
import {Colors} from '@momo-kits/foundation';
|
|
8
7
|
|
|
9
8
|
const Skeleton: React.FC<SkeletonTypes> = ({style}) => {
|
|
10
9
|
const [width, setWidth] = useState(0);
|