dhre-ui-kit 0.0.305 → 0.0.307
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/index.d.ts +3 -3
- package/lib/index.js +13 -13
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +13 -13
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -2090,7 +2090,10 @@ const styles$l = StyleSheet.create({
|
|
|
2090
2090
|
color: "#fff"
|
|
2091
2091
|
},
|
|
2092
2092
|
subContainer: {
|
|
2093
|
-
paddingHorizontal: horizontalScale(
|
|
2093
|
+
paddingHorizontal: horizontalScale(20),
|
|
2094
|
+
marginTop: verticalScale(8),
|
|
2095
|
+
alignSelf: "flex-start",
|
|
2096
|
+
alignItems: "flex-start"
|
|
2094
2097
|
},
|
|
2095
2098
|
subButtonText: {
|
|
2096
2099
|
textDecorationLine: "underline",
|
|
@@ -2108,12 +2111,13 @@ const Toast = React.forwardRef(
|
|
|
2108
2111
|
const [onBtnPress, setOnBtnPress] = useState(null);
|
|
2109
2112
|
const [progress, setProgress] = useState(0);
|
|
2110
2113
|
const [height, setHeight] = useState(72);
|
|
2111
|
-
const [onSubBtnPress, setOnSubBtnPress] = useState(
|
|
2114
|
+
const [onSubBtnPress, setOnSubBtnPress] = useState(
|
|
2115
|
+
null
|
|
2116
|
+
);
|
|
2112
2117
|
const [subjectText, setSubjectText] = useState(null);
|
|
2113
2118
|
const [warning, setWarning] = useState(false);
|
|
2114
|
-
const [toastStyle, setToastStyle] = useState();
|
|
2115
2119
|
const bottom = useRef(new Animated.Value(-80)).current;
|
|
2116
|
-
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false
|
|
2120
|
+
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false) => {
|
|
2117
2121
|
setMessage(toastMessage);
|
|
2118
2122
|
setIsSuccess(success);
|
|
2119
2123
|
setBtnText(buttonText);
|
|
@@ -2123,7 +2127,6 @@ const Toast = React.forwardRef(
|
|
|
2123
2127
|
setSubjectText(subText);
|
|
2124
2128
|
setOnSubBtnPress(() => subTextPress);
|
|
2125
2129
|
setWarning(warning2);
|
|
2126
|
-
setToastStyle(tostContainerStyle);
|
|
2127
2130
|
Animated.timing(bottom, {
|
|
2128
2131
|
toValue: 20,
|
|
2129
2132
|
duration: 500,
|
|
@@ -2163,8 +2166,7 @@ const Toast = React.forwardRef(
|
|
|
2163
2166
|
styles$l.container,
|
|
2164
2167
|
{ bottom },
|
|
2165
2168
|
{ backgroundColor: isSuccess ? "#00B578" : "#EB0542" },
|
|
2166
|
-
{ height: verticalScale(height) }
|
|
2167
|
-
toastStyle
|
|
2169
|
+
{ height: verticalScale(height) }
|
|
2168
2170
|
],
|
|
2169
2171
|
testID: "TOAST"
|
|
2170
2172
|
},
|
|
@@ -2190,8 +2192,7 @@ const Toast = React.forwardRef(
|
|
|
2190
2192
|
style: styles$l.buttonText
|
|
2191
2193
|
}
|
|
2192
2194
|
)
|
|
2193
|
-
))
|
|
2194
|
-
subjectText && /* @__PURE__ */ React.createElement(View, { style: styles$l.subContainer }, /* @__PURE__ */ React.createElement(
|
|
2195
|
+
)), subjectText && /* @__PURE__ */ React.createElement(View, { style: styles$l.subContainer }, /* @__PURE__ */ React.createElement(
|
|
2195
2196
|
Pressable,
|
|
2196
2197
|
{
|
|
2197
2198
|
style: styles$l.button,
|
|
@@ -2206,7 +2207,7 @@ const Toast = React.forwardRef(
|
|
|
2206
2207
|
style: styles$l.subButtonText
|
|
2207
2208
|
}
|
|
2208
2209
|
)
|
|
2209
|
-
)),
|
|
2210
|
+
))),
|
|
2210
2211
|
/* @__PURE__ */ React.createElement(
|
|
2211
2212
|
Progress.Bar,
|
|
2212
2213
|
{
|
|
@@ -3779,7 +3780,7 @@ class ToastService {
|
|
|
3779
3780
|
setRef(ref) {
|
|
3780
3781
|
this.toastRef = ref;
|
|
3781
3782
|
}
|
|
3782
|
-
showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false
|
|
3783
|
+
showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false) {
|
|
3783
3784
|
if (this.toastRef) {
|
|
3784
3785
|
this.toastRef.showToast(
|
|
3785
3786
|
message,
|
|
@@ -3790,8 +3791,7 @@ class ToastService {
|
|
|
3790
3791
|
height,
|
|
3791
3792
|
subText,
|
|
3792
3793
|
subTextPress,
|
|
3793
|
-
warning
|
|
3794
|
-
tostContainerStyle
|
|
3794
|
+
warning
|
|
3795
3795
|
);
|
|
3796
3796
|
}
|
|
3797
3797
|
}
|