@oneplatformdev/react-native-uikit 1.1.0 → 1.1.1
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 +1 -1
- package/registry/manifest.json +1 -1
- package/src/components/CustomAlert/types/types.ts +1 -0
- package/src/components/CustomAlert/ui/CustomAlert.tsx +5 -3
- package/src/components/HeaderWithBackButton/types/types.ts +1 -0
- package/src/components/HeaderWithBackButton/ui/HeaderWithBackButton.tsx +2 -1
package/package.json
CHANGED
package/registry/manifest.json
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"files": ["ui/CustomAlert.tsx", "presenters/useCustomAlert.ts", "ui/styles.ts", "types/types.ts", "index.ts"],
|
|
50
50
|
"componentDependencies": ["typography"],
|
|
51
51
|
"foundations": ["useUITheme", "useScaling", "Typography", "UIColors", "UISpacing", "UIRadius", "ScalingFunctions"],
|
|
52
|
-
"dependencies": ["react", "react-native", "@oneplatformdev/react-native-uikit"],
|
|
52
|
+
"dependencies": ["react", "react-native", "@oneplatformdev/react-native-uikit", "react-native-keyboard-controller"],
|
|
53
53
|
"rewrites": {
|
|
54
54
|
"../../../theme": "@oneplatformdev/react-native-uikit",
|
|
55
55
|
"../../../utils": "@oneplatformdev/react-native-uikit"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { Animated, Modal, Pressable, ScrollView, View } from 'react-native';
|
|
3
|
+
import { KeyboardAvoidingView } from 'react-native-keyboard-controller';
|
|
3
4
|
import { Typography } from '../../Typography';
|
|
4
5
|
import { useUITheme } from '../../../theme';
|
|
5
6
|
import { useScaling } from '../../../utils';
|
|
@@ -14,6 +15,7 @@ export const CustomAlert = ({
|
|
|
14
15
|
children,
|
|
15
16
|
footer,
|
|
16
17
|
showHandle = false,
|
|
18
|
+
isKeyboardAvoiding = false,
|
|
17
19
|
closeAction,
|
|
18
20
|
style,
|
|
19
21
|
contentStyle,
|
|
@@ -31,7 +33,7 @@ export const CustomAlert = ({
|
|
|
31
33
|
|
|
32
34
|
return (
|
|
33
35
|
<Modal visible={isVisible} transparent animationType="none" statusBarTranslucent onRequestClose={onClosePress}>
|
|
34
|
-
<
|
|
36
|
+
<KeyboardAvoidingView enabled={isKeyboardAvoiding} behavior="padding" style={styles.modalContainer}>
|
|
35
37
|
<Animated.View pointerEvents="none" style={[styles.backdrop, backdropStyle]} />
|
|
36
38
|
<Pressable
|
|
37
39
|
accessible={false}
|
|
@@ -45,7 +47,7 @@ export const CustomAlert = ({
|
|
|
45
47
|
onAccessibilityEscape={onClosePress}
|
|
46
48
|
style={[styles.alertContainer, alertStyle, style]}
|
|
47
49
|
>
|
|
48
|
-
<ScrollView bounces={false} showsVerticalScrollIndicator={false}>
|
|
50
|
+
<ScrollView bounces={false} showsVerticalScrollIndicator={false} keyboardShouldPersistTaps="handled">
|
|
49
51
|
{showHandle ? <View style={styles.handle} /> : null}
|
|
50
52
|
{header != null || closeAction ? (
|
|
51
53
|
<View style={styles.header}>
|
|
@@ -71,7 +73,7 @@ export const CustomAlert = ({
|
|
|
71
73
|
{footer != null ? <View style={styles.footer}>{footer}</View> : null}
|
|
72
74
|
</ScrollView>
|
|
73
75
|
</Animated.View>
|
|
74
|
-
</
|
|
76
|
+
</KeyboardAvoidingView>
|
|
75
77
|
</Modal>
|
|
76
78
|
);
|
|
77
79
|
};
|
|
@@ -16,6 +16,7 @@ export interface HeaderWithBackButtonProps {
|
|
|
16
16
|
titleSize?: TypographyProps['size'];
|
|
17
17
|
subtitleVariant?: TypographyProps['variant'];
|
|
18
18
|
subtitleSize?: TypographyProps['size'];
|
|
19
|
+
subtitleNumberOfLines?: number;
|
|
19
20
|
style?: StyleProp<ViewStyle>;
|
|
20
21
|
contentStyle?: StyleProp<ViewStyle>;
|
|
21
22
|
}
|
|
@@ -21,6 +21,7 @@ export const HeaderWithBackButton = ({
|
|
|
21
21
|
titleSize,
|
|
22
22
|
subtitleVariant = 'caption',
|
|
23
23
|
subtitleSize,
|
|
24
|
+
subtitleNumberOfLines = 1,
|
|
24
25
|
style,
|
|
25
26
|
contentStyle,
|
|
26
27
|
}: HeaderWithBackButtonProps) => {
|
|
@@ -71,7 +72,7 @@ export const HeaderWithBackButton = ({
|
|
|
71
72
|
text={subtitle}
|
|
72
73
|
variant={subtitleVariant}
|
|
73
74
|
size={subtitleSize}
|
|
74
|
-
numberOfLines={
|
|
75
|
+
numberOfLines={subtitleNumberOfLines}
|
|
75
76
|
style={[styles.subtitle, centered && styles.centeredText]}
|
|
76
77
|
/>
|
|
77
78
|
) : null}
|