ikualo-ui-kit-mobile 1.2.4 → 1.2.8
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
CHANGED
|
@@ -178,7 +178,7 @@ const dark = {
|
|
|
178
178
|
text_high_secondary: colors.secondary_300,
|
|
179
179
|
text_disabled: colors.gray_500,
|
|
180
180
|
|
|
181
|
-
text_btn: colors.
|
|
181
|
+
text_btn: colors.base_dark,
|
|
182
182
|
text_btn_alt: colors.secondary_alte,
|
|
183
183
|
text_btn_disabled: colors.gray_500,
|
|
184
184
|
text_home: colors.gray_200,
|
|
@@ -7,19 +7,15 @@ import React from 'react';
|
|
|
7
7
|
import useStore from '../../store';
|
|
8
8
|
import { IBtnContained } from '../../models';
|
|
9
9
|
|
|
10
|
-
|
|
11
10
|
export const BtnContained = (props: IBtnContained) => {
|
|
12
|
-
const { color, text, size, contentStyle, labelStyle, style, isDisabled, isLoading, onPress, isForm } =
|
|
11
|
+
const { color, text, size, contentStyle, labelStyle, style, isDisabled, isLoading, onPress, isForm } =
|
|
12
|
+
props;
|
|
13
13
|
const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);
|
|
14
|
-
const stylesButtonContained=getStylesButtonContained(useStore().theme);
|
|
14
|
+
const stylesButtonContained = getStylesButtonContained(useStore().theme);
|
|
15
15
|
useEffect(() => {
|
|
16
|
-
const keyboardDidShowListener = Keyboard.addListener(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
20
|
-
const keyboardDidHideListener = Keyboard.addListener(
|
|
21
|
-
'keyboardDidHide',
|
|
22
|
-
() => setIsKeyboardVisible(false)
|
|
16
|
+
const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', () => setIsKeyboardVisible(true));
|
|
17
|
+
const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () =>
|
|
18
|
+
setIsKeyboardVisible(false)
|
|
23
19
|
);
|
|
24
20
|
|
|
25
21
|
return () => {
|
|
@@ -28,33 +24,32 @@ export const BtnContained = (props: IBtnContained) => {
|
|
|
28
24
|
};
|
|
29
25
|
}, []);
|
|
30
26
|
return (
|
|
31
|
-
<>
|
|
32
|
-
((isForm && !isKeyboardVisible) || !isForm) &&
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
27
|
+
<>
|
|
28
|
+
{((isForm && !isKeyboardVisible) || !isForm) && (
|
|
29
|
+
<Button
|
|
30
|
+
disabled={isDisabled}
|
|
31
|
+
loading={isLoading}
|
|
32
|
+
labelStyle={[
|
|
33
|
+
stylesButtonContained['btn-contained-text'],
|
|
34
|
+
stylesButtonContained[`btn-contained--${size ?? 'md'}`],
|
|
35
|
+
{ color: stylesButtonContained[`btn-contained--${color ?? 'primary'}`].color },
|
|
36
|
+
isDisabled && stylesButtonContained[`btn-contained--disabled`],
|
|
37
|
+
labelStyle ?? '',
|
|
38
|
+
]}
|
|
39
|
+
contentStyle={[
|
|
40
|
+
stylesButtonContained['btn-contained'],
|
|
41
|
+
stylesButtonContained[`btn-contained--${color ?? 'primary'}`],
|
|
42
|
+
stylesButtonContained[`btn-contained--${size ?? 'md'}`],
|
|
43
|
+
isDisabled && stylesButtonContained[`btn-contained--disabled`],
|
|
44
|
+
contentStyle ?? '',
|
|
45
|
+
]}
|
|
46
|
+
style={[stylesButtonContained['btn-contained'], style ?? '']}
|
|
47
|
+
mode="contained"
|
|
48
|
+
onPress={() => !isLoading && onPress()}
|
|
49
|
+
>
|
|
50
|
+
{text}
|
|
51
|
+
</Button>
|
|
52
|
+
)}
|
|
58
53
|
</>
|
|
59
54
|
);
|
|
60
|
-
};
|
|
55
|
+
};
|