@dropi/react-native-design-system 0.3.26 → 0.3.27
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.
|
@@ -27,9 +27,9 @@ const DefaultButton = ({
|
|
|
27
27
|
return "m";
|
|
28
28
|
};
|
|
29
29
|
const getIconSize = () => {
|
|
30
|
-
if (size === "small") return
|
|
31
|
-
if (size === "large") return
|
|
32
|
-
return
|
|
30
|
+
if (size === "small") return _constants.sizes.s;
|
|
31
|
+
if (size === "large") return _constants.sizes.l;
|
|
32
|
+
return _constants.sizes.m;
|
|
33
33
|
};
|
|
34
34
|
const getTabletIconSize = () => {
|
|
35
35
|
if (size === "small") return 20;
|
|
@@ -99,20 +99,21 @@ const DefaultButton = ({
|
|
|
99
99
|
style: {
|
|
100
100
|
backgroundColor: currentButtonConfig.backgroundColor,
|
|
101
101
|
paddingVertical: getPaddingVertical(),
|
|
102
|
-
paddingHorizontal: _constants.spacing["size-4"],
|
|
102
|
+
paddingHorizontal: !label ? getPaddingVertical() : _constants.spacing["size-4"],
|
|
103
103
|
borderRadius: _constants.radius["border-2"],
|
|
104
104
|
alignItems: "center",
|
|
105
105
|
justifyContent: "center",
|
|
106
106
|
opacity: disabled ? 0.5 : 1,
|
|
107
107
|
borderWidth: 1,
|
|
108
108
|
borderColor: currentButtonConfig.borderColor,
|
|
109
|
-
flexDirection: "row"
|
|
109
|
+
flexDirection: "row",
|
|
110
|
+
alignSelf: !label ? 'flex-start' : 'stretch'
|
|
110
111
|
},
|
|
111
112
|
disabled: disabled || isMakingRequest,
|
|
112
113
|
...rest,
|
|
113
114
|
children: [preIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
114
115
|
style: {
|
|
115
|
-
marginRight: _constants.spacing["size-2"]
|
|
116
|
+
marginRight: label || postIcon ? _constants.spacing["size-2"] : 0
|
|
116
117
|
},
|
|
117
118
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Icon, {
|
|
118
119
|
name: preIcon,
|
|
@@ -121,7 +122,7 @@ const DefaultButton = ({
|
|
|
121
122
|
})
|
|
122
123
|
}), isMakingRequest ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
123
124
|
color: currentButtonConfig.labelColor
|
|
124
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Label, {
|
|
125
|
+
}) : !!label && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.Label, {
|
|
125
126
|
type: textVariant,
|
|
126
127
|
style: {
|
|
127
128
|
color: currentButtonConfig.labelColor
|
|
@@ -129,7 +130,7 @@ const DefaultButton = ({
|
|
|
129
130
|
children: label
|
|
130
131
|
}), postIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
131
132
|
style: {
|
|
132
|
-
marginLeft: _constants.spacing["size-2"]
|
|
133
|
+
marginLeft: label || preIcon ? _constants.spacing["size-2"] : 0
|
|
133
134
|
},
|
|
134
135
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative2.Icon, {
|
|
135
136
|
name: postIcon,
|