@momo-kits/foundation 0.92.6-rc.19 → 0.92.6-rc.21
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/Input.tsx +1 -1
- package/Layout/FloatingButton.tsx +20 -17
- package/Layout/Screen.tsx +1 -1
- package/package.json +1 -1
package/Input/Input.tsx
CHANGED
|
@@ -169,7 +169,7 @@ const Input = forwardRef(
|
|
|
169
169
|
<TextInput
|
|
170
170
|
{...props}
|
|
171
171
|
accessibilityLabel={accessibilityLabel}
|
|
172
|
-
editable={editable
|
|
172
|
+
editable={editable && !disabled}
|
|
173
173
|
secureTextEntry={secure}
|
|
174
174
|
textAlignVertical="center"
|
|
175
175
|
ref={inputRef}
|
|
@@ -38,31 +38,33 @@ export const FloatingButton: React.FC<FloatingButtonProps> = ({
|
|
|
38
38
|
const minWidth = size == 'small' ? 36 : 48;
|
|
39
39
|
const [widthAnimated, setWidthAnimated] = useState<Animated.Value>();
|
|
40
40
|
const lastOffset = useRef(0);
|
|
41
|
-
const
|
|
41
|
+
const lastDirection = useRef<string>();
|
|
42
42
|
const [showText, setShowText] = React.useState(true);
|
|
43
43
|
|
|
44
44
|
useEffect(() => {
|
|
45
45
|
if (!label) return;
|
|
46
46
|
|
|
47
47
|
const listener = animatedValue?.addListener(({value}) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const down = value > lastOffset.current;
|
|
48
|
+
if (value !== lastOffset.current) {
|
|
49
|
+
const direction = value > lastOffset.current ? 'down' : 'up';
|
|
51
50
|
lastOffset.current = value;
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
51
|
+
if (lastDirection.current !== direction) {
|
|
52
|
+
lastDirection.current = direction;
|
|
53
|
+
if (direction === 'down') {
|
|
54
|
+
Animated.timing(widthAnimated!, {
|
|
55
|
+
toValue: minWidth,
|
|
56
|
+
duration: 200,
|
|
57
|
+
useNativeDriver: false,
|
|
58
|
+
}).start(() => setShowText(false));
|
|
59
|
+
} else {
|
|
60
|
+
Animated.timing(widthAnimated!, {
|
|
61
|
+
toValue: maxWidth.current,
|
|
62
|
+
duration: 200,
|
|
63
|
+
useNativeDriver: false,
|
|
64
|
+
}).start(() => setShowText(true));
|
|
65
|
+
}
|
|
64
66
|
}
|
|
65
|
-
}
|
|
67
|
+
}
|
|
66
68
|
});
|
|
67
69
|
|
|
68
70
|
return () => {
|
|
@@ -122,6 +124,7 @@ export const FloatingButton: React.FC<FloatingButtonProps> = ({
|
|
|
122
124
|
<Text
|
|
123
125
|
style={styles.label}
|
|
124
126
|
color="white"
|
|
127
|
+
numberOfLines={1}
|
|
125
128
|
typography="action_default_bold">
|
|
126
129
|
{label}
|
|
127
130
|
</Text>
|
package/Layout/Screen.tsx
CHANGED
|
@@ -234,7 +234,7 @@ const Screen = forwardRef(
|
|
|
234
234
|
},
|
|
235
235
|
],
|
|
236
236
|
{
|
|
237
|
-
useNativeDriver:
|
|
237
|
+
useNativeDriver: true,
|
|
238
238
|
listener: (e: NativeSyntheticEvent<NativeScrollEvent>) => {
|
|
239
239
|
if (animatedHeader?.type == 'surface') {
|
|
240
240
|
const offsetY = e.nativeEvent.contentOffset.y;
|