sapo-components-ui-rn 1.0.11 → 1.0.13
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/dist/components/Button/index.d.ts +2 -1
- package/dist/index.esm.js +8 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +8 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Button/index.tsx +9 -7
- package/src/components/SelectionField/index.tsx +3 -3
package/package.json
CHANGED
|
@@ -39,6 +39,7 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
39
39
|
mode?: "outlined" | "contained" | "transparent";
|
|
40
40
|
transparent?: boolean;
|
|
41
41
|
onPress?: (res?: any) => void;
|
|
42
|
+
full?: boolean;
|
|
42
43
|
theme?: ThemeProp;
|
|
43
44
|
}
|
|
44
45
|
const Button = ({
|
|
@@ -62,6 +63,7 @@ const Button = ({
|
|
|
62
63
|
medium = false,
|
|
63
64
|
mode = "contained",
|
|
64
65
|
transparent = false,
|
|
66
|
+
full = false,
|
|
65
67
|
theme: themeOverrides,
|
|
66
68
|
...props
|
|
67
69
|
}: ButtonProps) => {
|
|
@@ -98,7 +100,11 @@ const Button = ({
|
|
|
98
100
|
};
|
|
99
101
|
|
|
100
102
|
return (
|
|
101
|
-
<View
|
|
103
|
+
<View
|
|
104
|
+
style={{
|
|
105
|
+
flexDirection: full ? "column" : "row",
|
|
106
|
+
}}
|
|
107
|
+
>
|
|
102
108
|
<ScaleButton
|
|
103
109
|
activeOpacity={0.8}
|
|
104
110
|
onPress={onPress}
|
|
@@ -134,9 +140,7 @@ const Button = ({
|
|
|
134
140
|
{!isLoading && left}
|
|
135
141
|
{left && <Spacer width={CONSTANTS.SPACE_8} />}
|
|
136
142
|
{isLoading ? (
|
|
137
|
-
<ActivityIndicator
|
|
138
|
-
color={textStyle?.color || colors.borderBrandDefault}
|
|
139
|
-
/>
|
|
143
|
+
<ActivityIndicator color={textStyle?.color || renderTextColor()} />
|
|
140
144
|
) : (
|
|
141
145
|
<Text
|
|
142
146
|
numberOfLines={1}
|
|
@@ -160,15 +164,13 @@ const Button = ({
|
|
|
160
164
|
};
|
|
161
165
|
|
|
162
166
|
const styles = StyleSheet.create({
|
|
163
|
-
container: {
|
|
164
|
-
flexDirection: "row",
|
|
165
|
-
},
|
|
166
167
|
disabled: { opacity: 0.6 },
|
|
167
168
|
button: {
|
|
168
169
|
height: CONSTANTS.BUTTON_HEIGHT,
|
|
169
170
|
flexDirection: "row",
|
|
170
171
|
alignItems: "center",
|
|
171
172
|
justifyContent: "space-between",
|
|
173
|
+
minWidth: CONSTANTS.DEVICE_WIDTH / 4.5,
|
|
172
174
|
},
|
|
173
175
|
border: {
|
|
174
176
|
borderWidth: CONSTANTS.BORDER_WIDTH_1,
|
|
@@ -129,8 +129,8 @@ const SelectionField = ({
|
|
|
129
129
|
},
|
|
130
130
|
]}
|
|
131
131
|
>
|
|
132
|
-
{label}
|
|
133
|
-
{required && <Text color={colors.textErrorDefault}
|
|
132
|
+
{label}
|
|
133
|
+
{required && <Text color={colors.textErrorDefault}> *</Text>}
|
|
134
134
|
</Text>
|
|
135
135
|
)}
|
|
136
136
|
<Text
|
|
@@ -142,7 +142,7 @@ const SelectionField = ({
|
|
|
142
142
|
>
|
|
143
143
|
{content.toString() === "" ? label : content}
|
|
144
144
|
{required && content.toString() === "" && (
|
|
145
|
-
<Text color={colors.textErrorDefault}
|
|
145
|
+
<Text color={colors.textErrorDefault}> *</Text>
|
|
146
146
|
)}
|
|
147
147
|
</Text>
|
|
148
148
|
</View>
|