@axelor/aos-mobile-ui 7.1.2 → 7.2.0
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/lib/components/atoms/Screen/Screen.js +13 -2
- package/lib/components/atoms/Screen/Screen.js.map +1 -1
- package/lib/components/molecules/Alert/Alert.d.ts +20 -0
- package/lib/components/molecules/Alert/Alert.js +124 -0
- package/lib/components/molecules/Alert/Alert.js.map +1 -0
- package/lib/components/molecules/BlockInteractionMessage/BlockInteractionMessage.js +1 -3
- package/lib/components/molecules/BlockInteractionMessage/BlockInteractionMessage.js.map +1 -1
- package/lib/components/molecules/Button/Button.d.ts +11 -4
- package/lib/components/molecules/Button/Button.js +34 -11
- package/lib/components/molecules/Button/Button.js.map +1 -1
- package/lib/components/molecules/CircleButton/CircleButton.d.ts +12 -5
- package/lib/components/molecules/CircleButton/CircleButton.js +11 -18
- package/lib/components/molecules/CircleButton/CircleButton.js.map +1 -1
- package/lib/components/molecules/InfoBubble/InfoBubble.js +2 -1
- package/lib/components/molecules/InfoBubble/InfoBubble.js.map +1 -1
- package/lib/components/molecules/ToggleSwitch/ToggleSwitch.d.ts +4 -1
- package/lib/components/molecules/ToggleSwitch/ToggleSwitch.js +4 -1
- package/lib/components/molecules/ToggleSwitch/ToggleSwitch.js.map +1 -1
- package/lib/components/molecules/index.d.ts +1 -2
- package/lib/components/molecules/index.js +1 -2
- package/lib/components/molecules/index.js.map +1 -1
- package/lib/components/organisms/AutoCompleteSearch/SearchDetailsPopUp.js +15 -20
- package/lib/components/organisms/AutoCompleteSearch/SearchDetailsPopUp.js.map +1 -1
- package/lib/components/organisms/FloatingButton/FloatingButton.js +17 -10
- package/lib/components/organisms/FloatingButton/FloatingButton.js.map +1 -1
- package/lib/components/organisms/index.d.ts +0 -2
- package/lib/components/organisms/index.js +0 -2
- package/lib/components/organisms/index.js.map +1 -1
- package/lib/utils/commons-styles.d.ts +2 -2
- package/lib/utils/commons-styles.js +6 -6
- package/lib/utils/commons-styles.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/molecules/IconButton/IconButton.d.ts +0 -12
- package/lib/components/molecules/IconButton/IconButton.js +0 -48
- package/lib/components/molecules/IconButton/IconButton.js.map +0 -1
- package/lib/components/molecules/PopUp/PopUp.d.ts +0 -10
- package/lib/components/molecules/PopUp/PopUp.js +0 -77
- package/lib/components/molecules/PopUp/PopUp.js.map +0 -1
- package/lib/components/organisms/PopUpOneButton/PopUpOneButton.d.ts +0 -9
- package/lib/components/organisms/PopUpOneButton/PopUpOneButton.js +0 -41
- package/lib/components/organisms/PopUpOneButton/PopUpOneButton.js.map +0 -1
- package/lib/components/organisms/PopUpTwoButton/PopUpTwoButton.d.ts +0 -11
- package/lib/components/organisms/PopUpTwoButton/PopUpTwoButton.js +0 -42
- package/lib/components/organisms/PopUpTwoButton/PopUpTwoButton.js.map +0 -1
|
@@ -15,11 +15,13 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import React, { useEffect, useMemo } from 'react';
|
|
18
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
19
19
|
import { ActivityIndicator, StyleSheet, View } from 'react-native';
|
|
20
20
|
import SystemNavigationBar from 'react-native-system-navigation-bar';
|
|
21
21
|
import { useThemeColor } from '../../../theme';
|
|
22
22
|
import { useConfig } from '../../../config/ConfigContext';
|
|
23
|
+
const FIXED_CONTAINER_PADDING_VERTICAL = 10;
|
|
24
|
+
const FIXED_ITEMS_NOT_DISPLAY_HEIGHT = FIXED_CONTAINER_PADDING_VERTICAL * 2 + 1;
|
|
23
25
|
const immersiveMode = async () => {
|
|
24
26
|
await SystemNavigationBar.navigationHide();
|
|
25
27
|
};
|
|
@@ -27,6 +29,11 @@ const Screen = ({ style, children, fixedItems, removeSpaceOnTop = false, loading
|
|
|
27
29
|
const Colors = useThemeColor();
|
|
28
30
|
const styles = useMemo(() => getStyles(Colors), [Colors]);
|
|
29
31
|
const { showActivityIndicator } = useConfig();
|
|
32
|
+
const [fixedItemsHeight, setFixedItemsHeight] = useState(0);
|
|
33
|
+
const onLayout = event => {
|
|
34
|
+
const { height } = event.nativeEvent.layout;
|
|
35
|
+
setFixedItemsHeight(height);
|
|
36
|
+
};
|
|
30
37
|
useEffect(() => {
|
|
31
38
|
immersiveMode();
|
|
32
39
|
}, []);
|
|
@@ -39,7 +46,10 @@ const Screen = ({ style, children, fixedItems, removeSpaceOnTop = false, loading
|
|
|
39
46
|
style,
|
|
40
47
|
]}>
|
|
41
48
|
{children}
|
|
42
|
-
{
|
|
49
|
+
{!!fixedItems && (<View style={fixedItemsHeight > FIXED_ITEMS_NOT_DISPLAY_HEIGHT && [
|
|
50
|
+
styles.fixedContainer,
|
|
51
|
+
styles.smallTopShadow,
|
|
52
|
+
]} onLayout={onLayout}>
|
|
43
53
|
{fixedItems}
|
|
44
54
|
</View>)}
|
|
45
55
|
</View>);
|
|
@@ -56,6 +66,7 @@ const getStyles = (Colors) => StyleSheet.create({
|
|
|
56
66
|
backgroundColor: Colors.backgroundColor,
|
|
57
67
|
borderTopLeftRadius: 13,
|
|
58
68
|
borderTopRightRadius: 13,
|
|
69
|
+
paddingVertical: FIXED_CONTAINER_PADDING_VERTICAL,
|
|
59
70
|
},
|
|
60
71
|
smallTopShadow: {
|
|
61
72
|
borderTopWidth: 0.5,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../../../src/components/atoms/Screen/Screen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,SAAS,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Screen.js","sourceRoot":"","sources":["../../../../src/components/atoms/Screen/Screen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,O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AClC,SAAS,EAAE,EAAE;QACb,aAAa,EAAE,GAAG;QAClB,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,UAAU;QAC7C,YAAY,EAAE,EAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAC;KACpC;IACD,SAAS,EAAE;QACT,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC;AAEL,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ButtonProps } from '../Button/Button';
|
|
2
|
+
interface ButtonConfig extends ButtonProps {
|
|
3
|
+
hide?: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface CancelButtonConfig extends ButtonConfig {
|
|
6
|
+
showInHeader?: boolean;
|
|
7
|
+
headerSize?: number;
|
|
8
|
+
}
|
|
9
|
+
interface AlertProps {
|
|
10
|
+
style?: any;
|
|
11
|
+
visible: boolean;
|
|
12
|
+
title?: string;
|
|
13
|
+
noBoldTitle?: boolean;
|
|
14
|
+
children: any;
|
|
15
|
+
cancelButtonConfig?: CancelButtonConfig;
|
|
16
|
+
confirmButtonConfig?: ButtonConfig;
|
|
17
|
+
translator?: (key: string) => string;
|
|
18
|
+
}
|
|
19
|
+
declare const Alert: ({ style, visible, title, noBoldTitle, children, cancelButtonConfig, confirmButtonConfig, translator, }: AlertProps) => JSX.Element;
|
|
20
|
+
export default Alert;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Axelor Business Solutions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
+
* as published by the Free Software Foundation.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
import React, { useMemo } from 'react';
|
|
19
|
+
import { StyleSheet, View, Modal } from 'react-native';
|
|
20
|
+
import { useThemeColor } from '../../../theme';
|
|
21
|
+
import { Card, Text, Icon } from '../../atoms';
|
|
22
|
+
import Button from '../Button/Button';
|
|
23
|
+
import { checkNullString } from '../../../utils';
|
|
24
|
+
const DEFAULT_BUTTON_WIDTH = 115;
|
|
25
|
+
const Alert = ({ style, visible = false, title, noBoldTitle = false, children, cancelButtonConfig, confirmButtonConfig, translator = key => key, }) => {
|
|
26
|
+
const Colors = useThemeColor();
|
|
27
|
+
const _cancelButtonConfig = useMemo(() => {
|
|
28
|
+
if (!cancelButtonConfig) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
title: translator('Base_Cancel'),
|
|
33
|
+
color: Colors.errorColor,
|
|
34
|
+
iconName: 'times',
|
|
35
|
+
hide: false,
|
|
36
|
+
showInHeader: false,
|
|
37
|
+
headerSize: 20,
|
|
38
|
+
width: DEFAULT_BUTTON_WIDTH,
|
|
39
|
+
...cancelButtonConfig,
|
|
40
|
+
};
|
|
41
|
+
}, [translator, Colors, cancelButtonConfig]);
|
|
42
|
+
const _confirmButtonConfig = useMemo(() => {
|
|
43
|
+
if (!confirmButtonConfig) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
title: translator('Base_OK'),
|
|
48
|
+
color: Colors.primaryColor,
|
|
49
|
+
iconName: 'check',
|
|
50
|
+
hide: false,
|
|
51
|
+
width: DEFAULT_BUTTON_WIDTH,
|
|
52
|
+
...confirmButtonConfig,
|
|
53
|
+
};
|
|
54
|
+
}, [translator, Colors, confirmButtonConfig]);
|
|
55
|
+
const isCancelButtonDisplayedBottom = useMemo(() => {
|
|
56
|
+
return !_cancelButtonConfig?.hide && !_cancelButtonConfig?.showInHeader;
|
|
57
|
+
}, [_cancelButtonConfig]);
|
|
58
|
+
const isConfirmButtonDisplayedBottom = useMemo(() => {
|
|
59
|
+
return !_confirmButtonConfig?.hide;
|
|
60
|
+
}, [_confirmButtonConfig]);
|
|
61
|
+
return (<Modal visible={visible} transparent animationType="fade" onRequestClose={_cancelButtonConfig?.onPress}>
|
|
62
|
+
<View style={styles.modalBackground}>
|
|
63
|
+
<Card style={[styles.container, style]}>
|
|
64
|
+
<View style={styles.headerContainer}>
|
|
65
|
+
{!checkNullString(title) && (<Text writingType={noBoldTitle ? null : 'title'} fontSize={20} style={[
|
|
66
|
+
styles.title,
|
|
67
|
+
{ marginHorizontal: _cancelButtonConfig?.headerSize },
|
|
68
|
+
]}>
|
|
69
|
+
{title}
|
|
70
|
+
</Text>)}
|
|
71
|
+
{!_cancelButtonConfig?.hide &&
|
|
72
|
+
_cancelButtonConfig?.showInHeader && (<Icon name="times" size={_cancelButtonConfig?.headerSize} style={styles.headerCancelButton} touchable onPress={_cancelButtonConfig?.onPress}/>)}
|
|
73
|
+
</View>
|
|
74
|
+
{children}
|
|
75
|
+
{(isCancelButtonDisplayedBottom ||
|
|
76
|
+
isConfirmButtonDisplayedBottom) && (<View style={styles.buttonsContainer}>
|
|
77
|
+
{isCancelButtonDisplayedBottom && (<Button {..._cancelButtonConfig} style={styles.cancelButton}/>)}
|
|
78
|
+
{isConfirmButtonDisplayedBottom && (<Button {..._confirmButtonConfig}/>)}
|
|
79
|
+
</View>)}
|
|
80
|
+
</Card>
|
|
81
|
+
</View>
|
|
82
|
+
</Modal>);
|
|
83
|
+
};
|
|
84
|
+
const styles = StyleSheet.create({
|
|
85
|
+
modalBackground: {
|
|
86
|
+
flex: 1,
|
|
87
|
+
justifyContent: 'center',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
90
|
+
},
|
|
91
|
+
container: {
|
|
92
|
+
width: '90%',
|
|
93
|
+
justifyContent: 'center',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
paddingHorizontal: 20,
|
|
96
|
+
paddingRight: 20,
|
|
97
|
+
paddingVertical: 15,
|
|
98
|
+
},
|
|
99
|
+
headerContainer: {
|
|
100
|
+
width: '100%',
|
|
101
|
+
justifyContent: 'center',
|
|
102
|
+
alignItems: 'center',
|
|
103
|
+
marginBottom: 10,
|
|
104
|
+
},
|
|
105
|
+
title: {
|
|
106
|
+
textAlign: 'center',
|
|
107
|
+
},
|
|
108
|
+
headerCancelButton: {
|
|
109
|
+
position: 'absolute',
|
|
110
|
+
right: 0,
|
|
111
|
+
top: 0,
|
|
112
|
+
},
|
|
113
|
+
buttonsContainer: {
|
|
114
|
+
width: '100%',
|
|
115
|
+
flexDirection: 'row',
|
|
116
|
+
justifyContent: 'flex-end',
|
|
117
|
+
marginTop: 10,
|
|
118
|
+
},
|
|
119
|
+
cancelButton: {
|
|
120
|
+
marginRight: 10,
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
export default Alert;
|
|
124
|
+
//# sourceMappingURL=Alert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Alert.js","sourceRoot":"","sources":["../../../../src/components/molecules/Alert/Alert.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AACrD,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,aAAa,CAAC;AAC7C,OAAO,MAAqB,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAC,eAAe,EAAC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a,EAAE,KAAK;QACpB,cAAc,EAAE,UAAU;QAC1B,SAAS,EAAE,EAAE;KACd;IACD,YAAY,EAAE;QACZ,WAAW,EAAE,EAAE;KAChB;CACF,CAAC,CAAC;AAEH,eAAe,KAAK,CAAC"}
|
|
@@ -17,12 +17,10 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import { StyleSheet, Dimensions, View } from 'react-native';
|
|
20
|
-
import { checkNullString } from '../../../utils/strings';
|
|
21
20
|
import { useConfig } from '../../../config/ConfigContext';
|
|
22
21
|
import { BlockInteractionScreen, Card } from '../../atoms';
|
|
23
22
|
import Button from '../Button/Button';
|
|
24
23
|
import WarningCard from '../WarningCard/WarningCard';
|
|
25
|
-
import IconButton from '../IconButton/IconButton';
|
|
26
24
|
/**
|
|
27
25
|
* @description To use this component, please use
|
|
28
26
|
* setBlockInteractionConfig({
|
|
@@ -50,7 +48,7 @@ const BlockInteractionMessage = ({}) => {
|
|
|
50
48
|
{Array.isArray(blockInteractionConfig.actionItems) &&
|
|
51
49
|
blockInteractionConfig.actionItems.length > 0 && (<View style={styles.buttonContainer}>
|
|
52
50
|
{blockInteractionConfig.actionItems.map((action, index) => {
|
|
53
|
-
return
|
|
51
|
+
return (<Button iconName={action.iconName} key={index} title={action.title} onPress={action.onPress} color={action.color} style={styles.width}/>);
|
|
54
52
|
})}
|
|
55
53
|
</View>)}
|
|
56
54
|
</Card>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockInteractionMessage.js","sourceRoot":"","sources":["../../../../src/components/molecules/BlockInteractionMessage/BlockInteractionMessage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"BlockInteractionMessage.js","sourceRoot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?: string | number;
|
|
4
|
+
color?: Color;
|
|
5
|
+
isNeutralBackground?: boolean;
|
|
6
|
+
iconName?: string;
|
|
7
|
+
iconSize?: number;
|
|
8
|
+
FontAwesome5?: boolean;
|
|
9
|
+
title?: string;
|
|
3
10
|
style?: any;
|
|
11
|
+
styleIcon?: any;
|
|
4
12
|
styleTxt?: any;
|
|
5
|
-
color?: Color;
|
|
6
|
-
title: string;
|
|
7
13
|
onPress?: () => void;
|
|
8
14
|
disabled?: boolean;
|
|
15
|
+
onDisabledPress?: () => void;
|
|
9
16
|
}
|
|
10
|
-
declare const Button: ({
|
|
17
|
+
declare const Button: ({ width, color, isNeutralBackground, iconName, iconSize, FontAwesome5, title, style, styleIcon, styleTxt, onPress, disabled, onDisabledPress, }: ButtonProps) => JSX.Element;
|
|
11
18
|
export default Button;
|
|
@@ -19,29 +19,52 @@ import React, { useMemo } from 'react';
|
|
|
19
19
|
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
20
20
|
import { getCommonStyles } from '../../../utils/commons-styles';
|
|
21
21
|
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
22
|
-
import { Text } from '../../atoms';
|
|
23
|
-
const Button = ({
|
|
22
|
+
import { Icon, Text } from '../../atoms';
|
|
23
|
+
const Button = ({ width = '90%', color, isNeutralBackground = false, iconName, iconSize = 15, FontAwesome5 = true, title, style, styleIcon, styleTxt, onPress = () => { }, disabled = false, onDisabledPress = null, }) => {
|
|
24
24
|
const Colors = useThemeColor();
|
|
25
|
-
const buttonColor = useMemo(() =>
|
|
25
|
+
const buttonColor = useMemo(() => {
|
|
26
|
+
if (disabled) {
|
|
27
|
+
return Colors.secondaryColor;
|
|
28
|
+
}
|
|
29
|
+
let _buttonColor = color != null ? color : Colors.primaryColor;
|
|
30
|
+
if (isNeutralBackground) {
|
|
31
|
+
_buttonColor = {
|
|
32
|
+
background: _buttonColor.background,
|
|
33
|
+
background_light: Colors.backgroundColor,
|
|
34
|
+
foreground: Colors.text,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return _buttonColor;
|
|
38
|
+
}, [color, Colors, disabled, isNeutralBackground]);
|
|
26
39
|
const styles = useMemo(() => {
|
|
27
|
-
return getStyles(buttonColor
|
|
28
|
-
}, [buttonColor]);
|
|
40
|
+
return getStyles(buttonColor, width);
|
|
41
|
+
}, [buttonColor, width]);
|
|
29
42
|
const commonStyles = useMemo(() => {
|
|
30
43
|
return getCommonStyles(Colors);
|
|
31
44
|
}, [Colors]);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
if (!iconName && !title) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return (<TouchableOpacity style={[commonStyles.button, styles.colorButton, style]} onPress={disabled ? onDisabledPress : onPress} disabled={disabled && !onDisabledPress} activeOpacity={0.9}>
|
|
49
|
+
{!!iconName && (<Icon name={iconName} FontAwesome5={FontAwesome5} size={iconSize} color={buttonColor.foreground} style={[styles.icon, styleIcon]}/>)}
|
|
50
|
+
{!!title && (<Text style={[styles.text, styleTxt]} fontSize={17} textColor={buttonColor.foreground}>
|
|
51
|
+
{title}
|
|
52
|
+
</Text>)}
|
|
36
53
|
</TouchableOpacity>);
|
|
37
54
|
};
|
|
38
|
-
const getStyles =
|
|
55
|
+
const getStyles = (color, width) => StyleSheet.create({
|
|
39
56
|
colorButton: {
|
|
40
|
-
backgroundColor:
|
|
57
|
+
backgroundColor: color.background_light,
|
|
58
|
+
borderColor: color.background,
|
|
59
|
+
width: width,
|
|
41
60
|
},
|
|
42
61
|
text: {
|
|
43
62
|
fontWeight: 'bold',
|
|
44
63
|
textAlign: 'center',
|
|
64
|
+
marginHorizontal: 5,
|
|
65
|
+
},
|
|
66
|
+
icon: {
|
|
67
|
+
marginHorizontal: 5,
|
|
45
68
|
},
|
|
46
69
|
});
|
|
47
70
|
export default Button;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/molecules/Button/Button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../src/components/molecules/Button/Button.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,aAAa,CAAC;AAmBvC,MAAM,MAAM,GAAG,CAAC,EACd,KAAK,GAAG,KAAK,EACb,KAAK,EACL,mBAAmB,GAAG,KAAK,EAC3B,QAAQ,EACR,QAAQ,GAAG,EAAE,EACb,YAAY,GAAG,IAAI,EACnB,KAAK,EACL,KAAK,EACL,SAAS,EACT,QAAQ,EACR,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,QAAQ,GAAG,KAAK,EAChB,eAAe,GAAG,IAAI,GACV,EAAE,EAAE;IAChB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;QAC/B,IAAI,QAAQ,EAAE;YACZ,OAAO,MAAM,CAAC,cAAc,CAAC;SAC9B;QAED,IAAI,YAAY,G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CACf,KAAK,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAC9B,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,EAChC,CACH,CACD;MAAA,CAAC,CAAC,CAAC,KAAK,IAAI,CACV,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAC/B,QAAQ,CAAC,CAAC,EAAE,CAAC,CACb,SAAS,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAClC;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,gBAAgB,CAAC,CACpB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,KAAsB,EAAE,EAAE,CACzD,UAAU,CAAC,MAAM,CAAC;IAChB,WAAW,EAAE;QACX,eAAe,EAAE,KAAK,CAAC,gBAAgB;QACvC,WAAW,EAAE,KAAK,CAAC,UAAU;QAC7B,KAAK,EAAE,KAAK;KACb;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,QAAQ;QACnB,gBAAgB,EAAE,CAAC;KACpB;IACD,IAAI,EAAE;QACJ,gBAAgB,EAAE,CAAC;KACpB;CACF,CAAC,CAAC;AAEL,eAAe,MAAM,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { Color } from '../../../theme/themes';
|
|
2
|
+
interface CircleButtonProps {
|
|
3
|
+
square?: boolean;
|
|
4
|
+
size?: number;
|
|
5
|
+
color?: Color;
|
|
6
|
+
isNeutralBackground?: boolean;
|
|
7
|
+
iconName: string;
|
|
8
|
+
FontAwesome5?: boolean;
|
|
2
9
|
style?: any;
|
|
10
|
+
onPress?: () => void;
|
|
3
11
|
disabled?: boolean;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}) => JSX.Element;
|
|
12
|
+
onDisabledPress?: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const CircleButton: ({ square, size, color, isNeutralBackground, iconName, FontAwesome5, style, onPress, disabled, onDisabledPress, }: CircleButtonProps) => JSX.Element;
|
|
8
15
|
export default CircleButton;
|
|
@@ -16,31 +16,24 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
import React, { useMemo } from 'react';
|
|
19
|
-
import { StyleSheet
|
|
20
|
-
import {
|
|
21
|
-
import { Icon } from '../../atoms';
|
|
19
|
+
import { StyleSheet } from 'react-native';
|
|
20
|
+
import { Button } from '../../molecules';
|
|
22
21
|
const BUTTON_SIZE = 50;
|
|
23
|
-
const CircleButton = ({
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
const CircleButton = ({ square = true, size = BUTTON_SIZE, color, isNeutralBackground = false, iconName, FontAwesome5 = true, style, onPress = () => { }, disabled = false, onDisabledPress = null, }) => {
|
|
23
|
+
const styles = useMemo(() => {
|
|
24
|
+
return getStyles(size, square);
|
|
25
|
+
}, [size, square]);
|
|
27
26
|
const iconSize = useMemo(() => Math.floor(size / 2), [size]);
|
|
28
|
-
return (<
|
|
29
|
-
<Icon name={iconName} color={color.foreground} size={iconSize} style={styles.icon}/>
|
|
30
|
-
</TouchableOpacity>);
|
|
27
|
+
return (<Button color={color} isNeutralBackground={isNeutralBackground} iconName={iconName} iconSize={iconSize} FontAwesome5={FontAwesome5} style={[styles.button, style]} styleIcon={styles.icon} onPress={onPress} disabled={disabled} onDisabledPress={onDisabledPress}/>);
|
|
31
28
|
};
|
|
32
|
-
const getStyles = (
|
|
33
|
-
|
|
34
|
-
backgroundColor: color,
|
|
35
|
-
borderRadius: size,
|
|
29
|
+
const getStyles = (size, square) => StyleSheet.create({
|
|
30
|
+
button: {
|
|
36
31
|
width: size,
|
|
37
32
|
height: size,
|
|
38
|
-
|
|
39
|
-
justifyContent: 'center',
|
|
40
|
-
alignItems: 'center',
|
|
33
|
+
borderRadius: square ? 13 : size,
|
|
41
34
|
},
|
|
42
35
|
icon: {
|
|
43
|
-
|
|
36
|
+
marginHorizontal: 0,
|
|
44
37
|
},
|
|
45
38
|
});
|
|
46
39
|
export default CircleButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircleButton.js","sourceRoot":"","sources":["../../../../src/components/molecules/CircleButton/CircleButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"CircleButton.js","sourceRoot":"","sources":["../../../../src/components/molecules/CircleButton/CircleButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAGvC,MAAM,WAAW,GAAG,EAAE,CAAC;AAevB,MAAM,YAAY,GAAG,CAAC,EACpB,MAAM,GAAG,IAAI,EACb,IAAI,GAAG,WAAW,EAClB,KAAK,EACL,mBAAmB,GAAG,KAAK,EAC3B,QAAQ,EACR,YAAY,GAAG,IAAI,EACnB,KAAK,EACL,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,EAClB,QAAQ,GAAG,KAAK,EAChB,eAAe,GAAG,IAAI,GACJ,EAAE,EAAE;IACtB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QAC1B,OAAO,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACjC,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAEnB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAE7D,OAAO,CACL,CAAC,MAAM,CACL,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,CACzC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAC9B,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CACvB,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,eAAe,CAAC,CAAC,eAAe,CAAC,EACjC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,MAAe,EAAE,EAAE,CAClD,UAAU,CAAC,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI;KACjC;IACD,IAAI,EAAE;QACJ,gBAAgB,EAAE,CAAC;KACpB;CACF,CAAC,CAAC;AAEL,eAAe,YAAY,CAAC"}
|
|
@@ -20,6 +20,7 @@ import { Dimensions, StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
|
20
20
|
import { Card, Icon, Text } from '../../atoms';
|
|
21
21
|
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
22
22
|
import { OUTSIDE_INDICATOR, useClickOutside, } from '../../../hooks/use-click-outside';
|
|
23
|
+
import { checkNullString } from '../../../utils';
|
|
23
24
|
const InfoBubble = ({ style, iconName, badgeColor, indication, textIndicationStyle, size = Dimensions.get('window').width * 0.07, position = 'right', coloredBubble = true, }) => {
|
|
24
25
|
const [isOpen, setIsOpen] = useState(false);
|
|
25
26
|
const wrapperRef = useRef(null);
|
|
@@ -38,7 +39,7 @@ const InfoBubble = ({ style, iconName, badgeColor, indication, textIndicationSty
|
|
|
38
39
|
<TouchableOpacity onPress={onPress} activeOpacity={0.95}>
|
|
39
40
|
<Icon name={iconName} style={coloredBubble ? styles.icon : null} color={coloredBubble ? badgeColor.foreground : badgeColor.background} size={coloredBubble ? size * 0.5 : size * 0.8}/>
|
|
40
41
|
</TouchableOpacity>
|
|
41
|
-
{isOpen ? (<Card style={[styles.indicationCard, textIndicationStyle]}>
|
|
42
|
+
{!checkNullString(indication) && isOpen ? (<Card style={[styles.indicationCard, textIndicationStyle]}>
|
|
42
43
|
<Text>{indication}</Text>
|
|
43
44
|
</Card>) : null}
|
|
44
45
|
</View>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InfoBubble.js","sourceRoot":"","sources":["../../../../src/components/molecules/InfoBubble/InfoBubble.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AAClE,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"InfoBubble.js","sourceRoot":"","sources":["../../../../src/components/molecules/InfoBubble/InfoBubble.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAE,QAAQ,E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AAQ,EAAE,EAAE,CAC/D,UAAU,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE;QACT,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;KACxB;IACD,IAAI,EAAE;QACJ,SAAS,EAAE,QAAQ;QACnB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,UAAU,CAAC,gBAAgB;QAC5C,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,UAAU,CAAC,UAAU;QAClC,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;KACb;IACD,cAAc,EAAE;QACd,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,EAAE;QACf,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,EAAE;QAChB,MAAM,EAAE,EAAE;QACV,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,EACtC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,IAAI;KACxC;CACF,CAAC,CAAC;AAEL,eAAe,UAAU,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
1
2
|
interface ToggleSwitchProps {
|
|
2
3
|
styleContainer?: any;
|
|
3
4
|
styleToogle?: any;
|
|
4
5
|
leftTitle: string;
|
|
6
|
+
leftElement?: ReactElement | JSX.Element;
|
|
5
7
|
rightTitle: string;
|
|
8
|
+
rigthElement?: ReactElement | JSX.Element;
|
|
6
9
|
onSwitch: () => void;
|
|
7
10
|
}
|
|
8
|
-
declare const ToggleSwitch: ({ styleContainer, styleToogle, leftTitle, rightTitle, onSwitch, }: ToggleSwitchProps) => JSX.Element;
|
|
11
|
+
declare const ToggleSwitch: ({ styleContainer, styleToogle, leftTitle, leftElement, rightTitle, rigthElement, onSwitch, }: ToggleSwitchProps) => JSX.Element;
|
|
9
12
|
export default ToggleSwitch;
|
|
@@ -19,7 +19,7 @@ import React, { useMemo, useState } from 'react';
|
|
|
19
19
|
import { Dimensions, StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
20
20
|
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
21
21
|
import { Text } from '../../atoms';
|
|
22
|
-
const ToggleSwitch = ({ styleContainer, styleToogle, leftTitle, rightTitle, onSwitch = () => { }, }) => {
|
|
22
|
+
const ToggleSwitch = ({ styleContainer, styleToogle, leftTitle, leftElement, rightTitle, rigthElement, onSwitch = () => { }, }) => {
|
|
23
23
|
const Colors = useThemeColor();
|
|
24
24
|
const [active, setActive] = useState(true);
|
|
25
25
|
const styles = useMemo(() => getStyles(Colors), [Colors]);
|
|
@@ -34,9 +34,11 @@ const ToggleSwitch = ({ styleContainer, styleToogle, leftTitle, rightTitle, onSw
|
|
|
34
34
|
return (<View style={[styles.container, styleContainer]}>
|
|
35
35
|
<TouchableOpacity style={[styles.toggle, active && styles.active, styleToogle]} disabled={active} onPress={onLeftPress}>
|
|
36
36
|
<Text>{leftTitle}</Text>
|
|
37
|
+
{leftElement != null && React.cloneElement(leftElement)}
|
|
37
38
|
</TouchableOpacity>
|
|
38
39
|
<TouchableOpacity style={[styles.toggle, !active && styles.active, styleToogle]} disabled={!active} onPress={onRightPress}>
|
|
39
40
|
<Text>{rightTitle}</Text>
|
|
41
|
+
{rigthElement != null && React.cloneElement(rigthElement)}
|
|
40
42
|
</TouchableOpacity>
|
|
41
43
|
</View>);
|
|
42
44
|
};
|
|
@@ -57,6 +59,7 @@ const getStyles = Colors => StyleSheet.create({
|
|
|
57
59
|
borderRadius: 50,
|
|
58
60
|
justifyContent: 'center',
|
|
59
61
|
alignItems: 'center',
|
|
62
|
+
flexDirection: 'row',
|
|
60
63
|
},
|
|
61
64
|
active: {
|
|
62
65
|
backgroundColor: Colors.primaryColor.background_light,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleSwitch.js","sourceRoot":"","sources":["../../../../src/components/molecules/ToggleSwitch/ToggleSwitch.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ToggleSwitch.js","sourceRoot":"","sources":["../../../../src/components/molecules/ToggleSwitch/ToggleSwitch.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAe,OAAO,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AAYjC,MAAM,YAAY,GAAG,CAAC,EACpB,cAAc,EACd,WAAW,EACX,SAAS,EACT,WAAW,EACX,UAAU,EACV,YAAY,EACZ,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,GACD,EAAE,EAAE;IACtB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE3C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1D,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,GAAG,EAAE;QACxB,SAAS,CAAC,KAAK,CAAC,CAAC;Q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M,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;KACX;IACD,MAAM,EAAE;QACN,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,GAAG,IAAI;QAC5C,OAAO,EAAE,CAAC;QACV,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,aAAa,EAAE,KAAK;KACrB;IACD,MAAM,EAAE;QACN,eAAe,EAAE,MAAM,CAAC,YAAY,CAAC,gBAAgB;KACtD;CACF,CAAC,CAAC;AACL,eAAe,YAAY,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as Alert } from './Alert/Alert';
|
|
1
2
|
export { default as AttachmentCard } from './AttachmentCard/AttachmentCard';
|
|
2
3
|
export { default as Badge } from './Badge/Badge';
|
|
3
4
|
export { default as BlockInteractionMessage } from './BlockInteractionMessage/BlockInteractionMessage';
|
|
@@ -15,7 +16,6 @@ export { default as FormIncrementInput } from './FormIncrementInput/FormIncremen
|
|
|
15
16
|
export { default as FormInput } from './FormInput/FormInput';
|
|
16
17
|
export { default as FromTo } from './FromTo/FromTo';
|
|
17
18
|
export { default as HalfLabelCard } from './HalfLabelCard/HalfLabelCard';
|
|
18
|
-
export { default as IconButton } from './IconButton/IconButton';
|
|
19
19
|
export { default as IconInput } from './IconInput/IconInput';
|
|
20
20
|
export { default as Image } from './Image/Image';
|
|
21
21
|
export { default as Increment } from './Increment/Increment';
|
|
@@ -29,7 +29,6 @@ export { default as MultiValuePickerButton } from './MultiValuePickerButton/Mult
|
|
|
29
29
|
export { default as NotesCard } from './NotesCard/NotesCard';
|
|
30
30
|
export { default as NumberBubble } from './NumberBubble/NumberBubble';
|
|
31
31
|
export { default as PanelTabs } from './PanelTabs/PanelTabs';
|
|
32
|
-
export { default as PopUp } from './PopUp/PopUp';
|
|
33
32
|
export { default as RadioSelect } from './RadioSelect/RadioSelect';
|
|
34
33
|
export { default as RightIconButton } from './RightIconButton/RightIconButton';
|
|
35
34
|
export { default as SelectionContainer } from './SelectionContainer/SelectionContainer';
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
+
export { default as Alert } from './Alert/Alert';
|
|
18
19
|
export { default as AttachmentCard } from './AttachmentCard/AttachmentCard';
|
|
19
20
|
export { default as Badge } from './Badge/Badge';
|
|
20
21
|
export { default as BlockInteractionMessage } from './BlockInteractionMessage/BlockInteractionMessage';
|
|
@@ -32,7 +33,6 @@ export { default as FormIncrementInput } from './FormIncrementInput/FormIncremen
|
|
|
32
33
|
export { default as FormInput } from './FormInput/FormInput';
|
|
33
34
|
export { default as FromTo } from './FromTo/FromTo';
|
|
34
35
|
export { default as HalfLabelCard } from './HalfLabelCard/HalfLabelCard';
|
|
35
|
-
export { default as IconButton } from './IconButton/IconButton';
|
|
36
36
|
export { default as IconInput } from './IconInput/IconInput';
|
|
37
37
|
export { default as Image } from './Image/Image';
|
|
38
38
|
export { default as Increment } from './Increment/Increment';
|
|
@@ -46,7 +46,6 @@ export { default as MultiValuePickerButton } from './MultiValuePickerButton/Mult
|
|
|
46
46
|
export { default as NotesCard } from './NotesCard/NotesCard';
|
|
47
47
|
export { default as NumberBubble } from './NumberBubble/NumberBubble';
|
|
48
48
|
export { default as PanelTabs } from './PanelTabs/PanelTabs';
|
|
49
|
-
export { default as PopUp } from './PopUp/PopUp';
|
|
50
49
|
export { default as RadioSelect } from './RadioSelect/RadioSelect';
|
|
51
50
|
export { default as RightIconButton } from './RightIconButton/RightIconButton';
|
|
52
51
|
export { default as SelectionContainer } from './SelectionContainer/SelectionContainer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/molecules/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,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gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC"}
|
|
@@ -16,10 +16,9 @@
|
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
import React, { useState, useCallback, useEffect } from 'react';
|
|
19
|
-
import { Dimensions, StyleSheet } from 'react-native';
|
|
19
|
+
import { Dimensions, StyleSheet, View } from 'react-native';
|
|
20
20
|
import { checkNullString } from '../../../utils/strings';
|
|
21
|
-
import {
|
|
22
|
-
import { PopUp } from '../../molecules';
|
|
21
|
+
import { Alert } from '../../molecules';
|
|
23
22
|
import { AutoCompleteSearch, ScrollList } from '../../organisms';
|
|
24
23
|
import ItemCard from './ItemCard';
|
|
25
24
|
const SearchDetailsPopUp = ({ isVisible, objectList, value = null, placeholder, displayValue, onClose, onSelect, fetchData, loadingList, moreLoading, isListEnd, translator, }) => {
|
|
@@ -38,31 +37,27 @@ const SearchDetailsPopUp = ({ isVisible, objectList, value = null, placeholder,
|
|
|
38
37
|
if (!isVisible) {
|
|
39
38
|
return null;
|
|
40
39
|
}
|
|
41
|
-
return (<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
return (<Alert visible={isVisible} style={styles.popup} cancelButtonConfig={{
|
|
41
|
+
showInHeader: true,
|
|
42
|
+
onPress: onClose,
|
|
43
|
+
}}>
|
|
44
|
+
<View style={styles.container}>
|
|
45
|
+
<AutoCompleteSearch objectList={objectList} onChangeValue={onSelect} fetchData={filterAPI} displayValue={displayValue} placeholder={placeholder} oneFilter={true} showDetailsPopup={false} style={styles.input}/>
|
|
46
|
+
<ScrollList style={styles.scroll} loadingList={loadingList} data={objectList} renderItem={({ item }) => (<ItemCard onSelect={() => onSelect(item)} title={displayValue(item)} isSelected={value === displayValue(item)}/>)} fetchData={scrollAPI} moreLoading={moreLoading} isListEnd={isListEnd} filter={!checkNullString(searchText)} translator={translator}/>
|
|
47
|
+
</View>
|
|
48
|
+
</Alert>);
|
|
46
49
|
};
|
|
47
50
|
const styles = StyleSheet.create({
|
|
48
51
|
popup: {
|
|
49
52
|
height: Dimensions.get('window').height * 0.9,
|
|
50
|
-
|
|
51
|
-
paddingRight:
|
|
52
|
-
paddingVertical:
|
|
53
|
+
paddingHorizontal: 10,
|
|
54
|
+
paddingRight: 10,
|
|
55
|
+
paddingVertical: 10,
|
|
53
56
|
position: 'absolute',
|
|
54
57
|
top: '5%',
|
|
55
58
|
},
|
|
56
59
|
container: {
|
|
57
|
-
|
|
58
|
-
justifyContent: 'center',
|
|
59
|
-
alignItems: 'center',
|
|
60
|
-
width: '100%',
|
|
61
|
-
height: '100%',
|
|
62
|
-
},
|
|
63
|
-
closeIcon: {
|
|
64
|
-
alignSelf: 'flex-end',
|
|
65
|
-
marginRight: 5,
|
|
60
|
+
marginTop: 10,
|
|
66
61
|
},
|
|
67
62
|
input: {
|
|
68
63
|
width: '90%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchDetailsPopUp.js","sourceRoot":"","sources":["../../../../src/components/organisms/AutoCompleteSearch/SearchDetailsPopUp.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"SearchDetailsPopUp.js","sourceRoot":"","sources":["../../../../src/components/organisms/AutoCompleteSearch/SearchDetailsPopUp.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAC,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAC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UAAU,CAAC,CAAC,CACrC,UAAU,CAAC,CAAC,UAAU,CAAC,EAE3B;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE;QACL,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,GAAG,GAAG;QAC7C,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,EAAE;QACnB,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,IAAI;KACV;IACD,SAAS,EAAE;QACT,SAAS,EAAE,EAAE;KACd;IACD,KAAK,EAAE;QACL,KAAK,EAAE,KAAK;KACb;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,CAAC;QACX,MAAM,EAAE,KAAK;KACd;CACF,CAAC,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
|
|
@@ -25,12 +25,12 @@ import { CircleButton } from '../../molecules';
|
|
|
25
25
|
const FLOATING_BUTTON_SIZE = 60;
|
|
26
26
|
const ACTION_BUTTON_SIZE_PERCENTAGE = 0.8;
|
|
27
27
|
const MIN_ACTION_BUTTON_WIDTH = 200;
|
|
28
|
-
const FloatingActionButton = ({ actionKey, title, iconName,
|
|
28
|
+
const FloatingActionButton = ({ actionKey, title, iconName, buttonParams, disabled = false, onPress, translator, }) => {
|
|
29
29
|
const Colors = useThemeColor();
|
|
30
30
|
const styles = useMemo(() => getStyles(Colors), [Colors]);
|
|
31
31
|
const handleActionPress = useCallback(() => onPress(actionKey), [actionKey, onPress]);
|
|
32
32
|
return (<View style={styles.actionButtonContainer}>
|
|
33
|
-
<CircleButton iconName={iconName} size={size} onPress={handleActionPress} disabled={disabled}/>
|
|
33
|
+
<CircleButton iconName={iconName} size={buttonParams.size} onPress={handleActionPress} disabled={disabled} style={{ marginRight: buttonParams.marginRight }}/>
|
|
34
34
|
<View style={styles.actionTitleContainer}>
|
|
35
35
|
<Text fontSize={16} style={styles.actionTitle}>
|
|
36
36
|
{translator(title)}
|
|
@@ -52,14 +52,21 @@ const FloatingButton = ({ actions, iconName = 'plus', size = FLOATING_BUTTON_SIZ
|
|
|
52
52
|
setIsOpen(false);
|
|
53
53
|
}
|
|
54
54
|
}, [clickOutside, isOpen]);
|
|
55
|
-
const
|
|
55
|
+
const actionButtonParams = useMemo(() => {
|
|
56
|
+
const actionButtonSize = Math.floor(size * ACTION_BUTTON_SIZE_PERCENTAGE);
|
|
57
|
+
const actionButtonMarginRight = Math.floor((size - actionButtonSize) / 2);
|
|
58
|
+
return {
|
|
59
|
+
size: actionButtonSize,
|
|
60
|
+
marginRight: actionButtonMarginRight,
|
|
61
|
+
};
|
|
62
|
+
}, [size]);
|
|
56
63
|
const onActionPress = useCallback(actionPress => {
|
|
57
64
|
actionPress();
|
|
58
65
|
setIsOpen(false);
|
|
59
66
|
}, []);
|
|
60
67
|
const actionComponents = useMemo(() => actions
|
|
61
68
|
?.reverse()
|
|
62
|
-
?.map(action => (<FloatingActionButton key={action.key} actionKey={action.key} title={action.title} iconName={action.iconName}
|
|
69
|
+
?.map(action => (<FloatingActionButton key={action.key} actionKey={action.key} title={action.title} iconName={action.iconName} buttonParams={actionButtonParams} disabled={action.disabled} onPress={() => onActionPress(action.onPress)} translator={translator}/>)), [actions, actionButtonParams, onActionPress, translator]);
|
|
63
70
|
const styles = useMemo(() => getStyles(Colors), [Colors]);
|
|
64
71
|
const handleFLoatingButtonPress = useCallback(() => {
|
|
65
72
|
animationUtil.animateNext();
|
|
@@ -70,7 +77,7 @@ const FloatingButton = ({ actions, iconName = 'plus', size = FLOATING_BUTTON_SIZ
|
|
|
70
77
|
}
|
|
71
78
|
return (<View ref={wrapperRef} style={[styles.container, style]}>
|
|
72
79
|
{isOpen && (<View style={styles.actionsContainer}>{actionComponents}</View>)}
|
|
73
|
-
<CircleButton iconName={isOpen ? 'times' : iconName} onPress={handleFLoatingButtonPress} size={size}/>
|
|
80
|
+
<CircleButton iconName={isOpen ? 'times' : iconName} onPress={handleFLoatingButtonPress} size={size} style={styles.floatingButton}/>
|
|
74
81
|
</View>);
|
|
75
82
|
};
|
|
76
83
|
const getStyles = (Colors) => StyleSheet.create({
|
|
@@ -79,11 +86,10 @@ const getStyles = (Colors) => StyleSheet.create({
|
|
|
79
86
|
marginTop: 7,
|
|
80
87
|
},
|
|
81
88
|
actionsContainer: {
|
|
82
|
-
|
|
83
|
-
paddingHorizontal: 7,
|
|
89
|
+
marginBottom: 10,
|
|
84
90
|
},
|
|
85
91
|
actionTitleContainer: {
|
|
86
|
-
backgroundColor: Colors.
|
|
92
|
+
backgroundColor: Colors.backgroundColor,
|
|
87
93
|
marginHorizontal: 15,
|
|
88
94
|
marginVertical: 10,
|
|
89
95
|
justifyContent: 'center',
|
|
@@ -101,8 +107,9 @@ const getStyles = (Colors) => StyleSheet.create({
|
|
|
101
107
|
container: {
|
|
102
108
|
justifyContent: 'flex-end',
|
|
103
109
|
alignItems: 'flex-end',
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
},
|
|
111
|
+
floatingButton: {
|
|
112
|
+
alignSelf: 'flex-end',
|
|
106
113
|
},
|
|
107
114
|
});
|
|
108
115
|
export default FloatingButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingButton.js","sourceRoot":"","sources":["../../../../src/components/organisms/FloatingButton/FloatingButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAkB7C,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAC1C,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,MAAM,oBAAoB,GAAG,CAAC,EAC5B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"FloatingButton.js","sourceRoot":"","sources":["../../../../src/components/organisms/FloatingButton/FloatingButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EACL,iBAAiB,EACjB,eAAe,GAChB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAkB7C,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAC1C,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,MAAM,oBAAoB,GAAG,CAAC,EAC5B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,UAAU,GASX,EAAE,EAAE;IACH,MAAM,MAAM,GAAG,aAAa,EAAE,CAA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AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,MAAmB,EAAE,EAAE,CACxC,UAAU,CAAC,MAAM,CAAC;IAChB,qBAAqB,EAAE;QACrB,aAAa,EAAE,aAAa;QAC5B,SAAS,EAAE,CAAC;KACb;IACD,gBAAgB,EAAE;QAChB,YAAY,EAAE,EAAE;KACjB;IACD,oBAAoB,EAAE;QACpB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,gBAAgB,EAAE,EAAE;QACpB,cAAc,EAAE,EAAE;QAClB,cAAc,EAAE,QAAQ;QACxB,UAAU,EAAE,QAAQ;QACpB,QAAQ,EAAE,uBAAuB;QACjC,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,CAAC;QACZ,aAAa,EAAE,GAAG;QAClB,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,UAAU;QAC7C,YAAY,EAAE,EAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAC;KACpC;IACD,WAAW,EAAE;QACX,SAAS,EAAE,QAAQ;KACpB;IACD,SAAS,EAAE;QACT,cAAc,EAAE,UAAU;QAC1B,UAAU,EAAE,UAAU;KACvB;IACD,cAAc,EAAE;QACd,SAAS,EAAE,UAAU;KACtB;CACF,CAAC,CAAC;AAEL,eAAe,cAAc,CAAC"}
|
|
@@ -7,8 +7,6 @@ export { default as HeaderContainer } from './HeaderContainer/HeaderContainer';
|
|
|
7
7
|
export { default as ImageBubble } from './ImageBubble/ImageBubble';
|
|
8
8
|
export { default as MultiValuePicker } from './MultiValuePicker/MultiValuePicker';
|
|
9
9
|
export { default as Picker } from './Picker/Picker';
|
|
10
|
-
export { default as PopUpOneButton } from './PopUpOneButton/PopUpOneButton';
|
|
11
|
-
export { default as PopUpTwoButton } from './PopUpTwoButton/PopUpTwoButton';
|
|
12
10
|
export { default as ProgressBar } from './ProgressBar/ProgressBar';
|
|
13
11
|
export { default as ScrollList } from './ScrollList/ScrollList';
|
|
14
12
|
export { default as SearchBar } from './SearchBar/SearchBar';
|
|
@@ -24,8 +24,6 @@ export { default as HeaderContainer } from './HeaderContainer/HeaderContainer';
|
|
|
24
24
|
export { default as ImageBubble } from './ImageBubble/ImageBubble';
|
|
25
25
|
export { default as MultiValuePicker } from './MultiValuePicker/MultiValuePicker';
|
|
26
26
|
export { default as Picker } from './Picker/Picker';
|
|
27
|
-
export { default as PopUpOneButton } from './PopUpOneButton/PopUpOneButton';
|
|
28
|
-
export { default as PopUpTwoButton } from './PopUpTwoButton/PopUpTwoButton';
|
|
29
27
|
export { default as ProgressBar } from './ProgressBar/ProgressBar';
|
|
30
28
|
export { default as ScrollList } from './ScrollList/ScrollList';
|
|
31
29
|
export { default as SearchBar } from './SearchBar/SearchBar';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/organisms/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/organisms/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,kBAAkB,EAAC,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AAChF,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,uBAAuB,CAAC"}
|
|
@@ -29,13 +29,13 @@ export function getCommonStyles(Colors: any, _required?: boolean): {
|
|
|
29
29
|
justifyContent: "center";
|
|
30
30
|
alignItems: "center";
|
|
31
31
|
alignContent: "center";
|
|
32
|
+
paddingHorizontal: number;
|
|
32
33
|
paddingVertical: number;
|
|
33
34
|
marginVertical: number;
|
|
34
35
|
borderRadius: number;
|
|
35
|
-
|
|
36
|
+
borderWidth: number;
|
|
36
37
|
height: number;
|
|
37
38
|
minHeight: number;
|
|
38
|
-
maxHeight: number;
|
|
39
39
|
};
|
|
40
40
|
inputFocused: {
|
|
41
41
|
borderWidth: number;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
16
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import {
|
|
18
|
+
import { StyleSheet } from 'react-native';
|
|
19
19
|
import { hexToRgb } from './commons-utlis';
|
|
20
20
|
export const getCommonStyles = (Colors, _required = false) => StyleSheet.create({
|
|
21
21
|
filter: {
|
|
@@ -45,13 +45,13 @@ export const getCommonStyles = (Colors, _required = false) => StyleSheet.create(
|
|
|
45
45
|
justifyContent: 'center',
|
|
46
46
|
alignItems: 'center',
|
|
47
47
|
alignContent: 'center',
|
|
48
|
+
paddingHorizontal: 5,
|
|
48
49
|
paddingVertical: 5,
|
|
49
50
|
marginVertical: 5,
|
|
50
|
-
borderRadius:
|
|
51
|
-
|
|
52
|
-
height:
|
|
53
|
-
minHeight:
|
|
54
|
-
maxHeight: 40,
|
|
51
|
+
borderRadius: 13,
|
|
52
|
+
borderWidth: 2,
|
|
53
|
+
height: 50,
|
|
54
|
+
minHeight: 40,
|
|
55
55
|
},
|
|
56
56
|
inputFocused: {
|
|
57
57
|
borderWidth: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commons-styles.js","sourceRoot":"","sources":["../../src/utils/commons-styles.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"commons-styles.js","sourceRoot":"","sources":["../../src/utils/commons-styles.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,SAAS,GAAG,KAAK,EAAE,EAAE,CAC3D,UAAU,CAAC,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,e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ED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Color } from '../../../theme/themes';
|
|
2
|
-
interface IconButtonProps {
|
|
3
|
-
style?: any;
|
|
4
|
-
color?: Color;
|
|
5
|
-
title: string;
|
|
6
|
-
iconName: string;
|
|
7
|
-
FontAwesome5?: boolean;
|
|
8
|
-
onPress: (any: any) => void;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
}
|
|
11
|
-
declare const IconButton: ({ style, color, title, iconName, FontAwesome5, onPress, disabled, }: IconButtonProps) => JSX.Element;
|
|
12
|
-
export default IconButton;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Axelor Business Solutions
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
-
* as published by the Free Software Foundation.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
*/
|
|
18
|
-
import React, { useMemo } from 'react';
|
|
19
|
-
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
20
|
-
import { getCommonStyles } from '../../../utils/commons-styles';
|
|
21
|
-
import { useThemeColor } from '../../../theme/ThemeContext';
|
|
22
|
-
import { Icon, Text } from '../../atoms';
|
|
23
|
-
const IconButton = ({ style, color, title, iconName, FontAwesome5 = true, onPress = () => { }, disabled = false, }) => {
|
|
24
|
-
const Colors = useThemeColor();
|
|
25
|
-
const buttonColor = useMemo(() => (color == null ? Colors.primaryColor : color), [Colors.primaryColor, color]);
|
|
26
|
-
const styles = useMemo(() => {
|
|
27
|
-
return getStyles(buttonColor);
|
|
28
|
-
}, [buttonColor]);
|
|
29
|
-
const commonStyle = useMemo(() => getCommonStyles(Colors), [Colors]);
|
|
30
|
-
return (<TouchableOpacity style={[styles.container, commonStyle.button, style]} onPress={onPress} disabled={disabled}>
|
|
31
|
-
<Icon name={iconName} FontAwesome5={FontAwesome5} size={15} color={buttonColor.foreground}/>
|
|
32
|
-
<Text style={styles.text}>{title}</Text>
|
|
33
|
-
</TouchableOpacity>);
|
|
34
|
-
};
|
|
35
|
-
const getStyles = color => StyleSheet.create({
|
|
36
|
-
container: {
|
|
37
|
-
backgroundColor: color.background,
|
|
38
|
-
},
|
|
39
|
-
text: {
|
|
40
|
-
color: color.foreground,
|
|
41
|
-
fontSize: 15,
|
|
42
|
-
fontWeight: 'bold',
|
|
43
|
-
textAlign: 'center',
|
|
44
|
-
marginLeft: 10,
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
export default IconButton;
|
|
48
|
-
//# sourceMappingURL=IconButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sourceRoot":"","sources":["../../../../src/components/molecules/IconButton/IconButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAE,gBAAgB,EAAC,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,aAAa,CAAC;AAavC,MAAM,UAAU,GAAG,CAAC,EAClB,KAAK,EACL,KAAK,EACL,KAAK,EACL,QAAQ,EACR,YAAY,GAAG,IAAI,EACn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AAe,EAAE,KAAK,CAAC,UAAU;KAClC;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,KAAK,CAAC,UAAU;QACvB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,EAAE;KACf;CACF,CAAC,CAAC;AAEL,eAAe,UAAU,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
interface PopUpProps {
|
|
2
|
-
style?: any;
|
|
3
|
-
visible: boolean;
|
|
4
|
-
title?: string;
|
|
5
|
-
data?: string;
|
|
6
|
-
children: any;
|
|
7
|
-
childrenStyle?: any;
|
|
8
|
-
}
|
|
9
|
-
declare const PopUp: ({ style, visible, title, data, children, childrenStyle, }: PopUpProps) => JSX.Element;
|
|
10
|
-
export default PopUp;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Axelor Business Solutions
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
-
* as published by the Free Software Foundation.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
*/
|
|
18
|
-
import React from 'react';
|
|
19
|
-
import { StyleSheet, View, Modal } from 'react-native';
|
|
20
|
-
import { checkNullString } from '../../../utils/strings';
|
|
21
|
-
import { Card, Text } from '../../atoms';
|
|
22
|
-
const PopUp = ({ style, visible, title, data, children, childrenStyle, }) => {
|
|
23
|
-
return (<Modal visible={visible} transparent animationType="fade" onRequestClose={() => console.log('closed')}>
|
|
24
|
-
<View style={styles.modalBackground}>
|
|
25
|
-
<Card style={[styles.container, style]}>
|
|
26
|
-
{!checkNullString(title) && (<View style={styles.headerContainer}>
|
|
27
|
-
<Text style={styles.header}>{title}</Text>
|
|
28
|
-
</View>)}
|
|
29
|
-
{!checkNullString(data) && (<View style={styles.contentContainer}>
|
|
30
|
-
<Text style={styles.text}>{data}</Text>
|
|
31
|
-
</View>)}
|
|
32
|
-
<View style={[styles.buttonContainer, childrenStyle]}>
|
|
33
|
-
{children}
|
|
34
|
-
</View>
|
|
35
|
-
</Card>
|
|
36
|
-
</View>
|
|
37
|
-
</Modal>);
|
|
38
|
-
};
|
|
39
|
-
const styles = StyleSheet.create({
|
|
40
|
-
modalBackground: {
|
|
41
|
-
flex: 1,
|
|
42
|
-
backgroundColor: 'rgba(0,0,0,0.5)',
|
|
43
|
-
justifyContent: 'center',
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
},
|
|
46
|
-
container: {
|
|
47
|
-
width: '80%',
|
|
48
|
-
justifyContent: 'center',
|
|
49
|
-
alignItems: 'center',
|
|
50
|
-
},
|
|
51
|
-
headerContainer: {
|
|
52
|
-
justifyContent: 'center',
|
|
53
|
-
alignItems: 'center',
|
|
54
|
-
width: '80%',
|
|
55
|
-
marginBottom: 8,
|
|
56
|
-
},
|
|
57
|
-
header: {
|
|
58
|
-
fontSize: 20,
|
|
59
|
-
fontWeight: 'bold',
|
|
60
|
-
},
|
|
61
|
-
contentContainer: {
|
|
62
|
-
justifyContent: 'center',
|
|
63
|
-
alignItems: 'center',
|
|
64
|
-
},
|
|
65
|
-
text: {
|
|
66
|
-
textAlign: 'center',
|
|
67
|
-
fontSize: 16,
|
|
68
|
-
},
|
|
69
|
-
buttonContainer: {
|
|
70
|
-
flexDirection: 'row',
|
|
71
|
-
justifyContent: 'center',
|
|
72
|
-
alignItems: 'center',
|
|
73
|
-
width: '80%',
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
export default PopUp;
|
|
77
|
-
//# sourceMappingURL=PopUp.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PopUp.js","sourceRoot":"","sources":["../../../../src/components/molecules/PopUp/PopUp.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC,MAAM,cAAc,CAAC;AACrD,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,aAAa,CAAC;AAWvC,MAAM,KAAK,GAAG,CAAC,EACb,KAAK,EACL,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,aAAa,GACF,EAAE,EAAE;IACf,OAAO,CACL,CAAC,KAAK,CACJ,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,WAAW,CACX,aAAa,CAAC,MAAM,CACpB,cAAc,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAC5C;MAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAClC;QAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACrC;UAAA,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAC1B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAClC;cAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAC3C;YAAA,EAAE,IAAI,CAAC,CACR,CACD;UAAA,CAAC,CAAC,eAAe,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eAAe,KAAK,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
interface PopUpOneButtonProps {
|
|
2
|
-
visible: boolean;
|
|
3
|
-
title: string;
|
|
4
|
-
data: string;
|
|
5
|
-
btnTitle: string;
|
|
6
|
-
onPress: () => void;
|
|
7
|
-
}
|
|
8
|
-
declare const PopUpOneButton: ({ visible, title, data, btnTitle, onPress, }: PopUpOneButtonProps) => JSX.Element;
|
|
9
|
-
export default PopUpOneButton;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Axelor Business Solutions
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
-
* as published by the Free Software Foundation.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
*/
|
|
18
|
-
import React, { useMemo } from 'react';
|
|
19
|
-
import { StyleSheet } from 'react-native';
|
|
20
|
-
import { useThemeColor } from '../../../theme';
|
|
21
|
-
import { Button, PopUp } from '../../molecules';
|
|
22
|
-
const PopUpOneButton = ({ visible, title, data, btnTitle, onPress, }) => {
|
|
23
|
-
const Colors = useThemeColor();
|
|
24
|
-
const styles = useMemo(() => getStyles(Colors), [Colors]);
|
|
25
|
-
return (<PopUp visible={visible} title={title} data={data}>
|
|
26
|
-
<Button style={styles.button} title={btnTitle} onPress={onPress}/>
|
|
27
|
-
</PopUp>);
|
|
28
|
-
};
|
|
29
|
-
const getStyles = (Colors) => StyleSheet.create({
|
|
30
|
-
button: {
|
|
31
|
-
alignSelf: 'center',
|
|
32
|
-
marginTop: 15,
|
|
33
|
-
elevation: 5,
|
|
34
|
-
shadowOpacity: 0.5,
|
|
35
|
-
shadowColor: Colors.secondaryColor.background,
|
|
36
|
-
shadowOffset: { width: 0, height: 0 },
|
|
37
|
-
width: '40%',
|
|
38
|
-
},
|
|
39
|
-
});
|
|
40
|
-
export default PopUpOneButton;
|
|
41
|
-
//# sourceMappingURL=PopUpOneButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PopUpOneButton.js","sourceRoot":"","sources":["../../../../src/components/organisms/PopUpOneButton/PopUpOneButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAc,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAC,MAAM,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAC;AAU9C,MAAM,cAAc,GAAG,CAAC,EACtB,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,OAAO,GACa,EAAE,EAAE;IACxB,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAChD;MAAA,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAClE;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,MAAmB,EAAE,EAAE,CACxC,UAAU,CAAC,MAAM,CAAC;IAChB,MAAM,EAAE;QACN,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,CAAC;QACZ,aAAa,EAAE,GAAG;QAClB,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,UAAU;QAC7C,YAAY,EAAE,EAAC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAC;QACnC,KAAK,EAAE,KAAK;KACb;CACF,CAAC,CAAC;AAEL,eAAe,cAAc,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface PopUpTwoButtonProps {
|
|
2
|
-
visible: boolean;
|
|
3
|
-
title: string;
|
|
4
|
-
data: string;
|
|
5
|
-
PrimaryBtnTitle: string;
|
|
6
|
-
onPressPrimary: () => void;
|
|
7
|
-
SecondaryBtnTitle: string;
|
|
8
|
-
onPressSecondary: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare const PopUpTwoButton: ({ visible, title, data, PrimaryBtnTitle, onPressPrimary, SecondaryBtnTitle, onPressSecondary, }: PopUpTwoButtonProps) => JSX.Element;
|
|
11
|
-
export default PopUpTwoButton;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Axelor Business Solutions
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2023 Axelor (<http://axelor.com>).
|
|
5
|
-
*
|
|
6
|
-
* This program is free software: you can redistribute it and/or modify
|
|
7
|
-
* it under the terms of the GNU Affero General Public License, version 3,
|
|
8
|
-
* as published by the Free Software Foundation.
|
|
9
|
-
*
|
|
10
|
-
* This program is distributed in the hope that it will be useful,
|
|
11
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
-
* GNU Affero General Public License for more details.
|
|
14
|
-
*
|
|
15
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
*/
|
|
18
|
-
import React, { useMemo } from 'react';
|
|
19
|
-
import { StyleSheet } from 'react-native';
|
|
20
|
-
import { useThemeColor } from '../../../theme';
|
|
21
|
-
import { Button, PopUp } from '../../molecules';
|
|
22
|
-
const PopUpTwoButton = ({ visible, title, data, PrimaryBtnTitle, onPressPrimary, SecondaryBtnTitle, onPressSecondary, }) => {
|
|
23
|
-
const Colors = useThemeColor();
|
|
24
|
-
const styles = useMemo(() => getStyles(Colors), [Colors]);
|
|
25
|
-
return (<PopUp visible={visible} title={title} data={data}>
|
|
26
|
-
<Button style={styles.button} color={Colors.secondaryColor} title={SecondaryBtnTitle} onPress={onPressSecondary}/>
|
|
27
|
-
<Button style={styles.button} color={Colors.primaryColor} title={PrimaryBtnTitle} onPress={onPressPrimary}/>
|
|
28
|
-
</PopUp>);
|
|
29
|
-
};
|
|
30
|
-
const getStyles = (Colors) => StyleSheet.create({
|
|
31
|
-
button: {
|
|
32
|
-
marginHorizontal: 4,
|
|
33
|
-
marginTop: 15,
|
|
34
|
-
elevation: 5,
|
|
35
|
-
shadowOpacity: 0.5,
|
|
36
|
-
shadowColor: Colors.secondaryColor.background,
|
|
37
|
-
shadowOffset: { width: 0, height: 0 },
|
|
38
|
-
width: '40%',
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
export default PopUpTwoButton;
|
|
42
|
-
//# sourceMappingURL=PopUpTwoButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PopUpTwoButton.js","sourceRoot":"","sources":["../../../../src/components/organisms/PopUpTwoButton/PopUpTwoButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAA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