dhre-ui-kit 0.0.303 → 0.0.304
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 +14 -5
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +14 -5
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -2111,8 +2111,10 @@ const Toast = React.forwardRef(
|
|
|
2111
2111
|
const [height, setHeight] = useState(72);
|
|
2112
2112
|
const [onSubBtnPress, setOnSubBtnPress] = useState(null);
|
|
2113
2113
|
const [subjectText, setSubjectText] = useState(null);
|
|
2114
|
+
const [warning, setWarning] = useState(false);
|
|
2115
|
+
const [toastStyle, setToastStyle] = useState();
|
|
2114
2116
|
const bottom = useRef(new Animated.Value(-80)).current;
|
|
2115
|
-
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null) => {
|
|
2117
|
+
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false, tostContainerStyle) => {
|
|
2116
2118
|
setMessage(toastMessage);
|
|
2117
2119
|
setIsSuccess(success);
|
|
2118
2120
|
setBtnText(buttonText);
|
|
@@ -2121,6 +2123,8 @@ const Toast = React.forwardRef(
|
|
|
2121
2123
|
setHeight(height2);
|
|
2122
2124
|
setSubjectText(subText);
|
|
2123
2125
|
setOnSubBtnPress(() => subTextPress);
|
|
2126
|
+
setWarning(warning2);
|
|
2127
|
+
setToastStyle(tostContainerStyle);
|
|
2124
2128
|
Animated.timing(bottom, {
|
|
2125
2129
|
toValue: 20,
|
|
2126
2130
|
duration: 500,
|
|
@@ -2160,11 +2164,12 @@ const Toast = React.forwardRef(
|
|
|
2160
2164
|
styles$l.container,
|
|
2161
2165
|
{ bottom },
|
|
2162
2166
|
{ backgroundColor: isSuccess ? "#00B578" : "#EB0542" },
|
|
2163
|
-
{ height: verticalScale(height) }
|
|
2167
|
+
{ height: verticalScale(height) },
|
|
2168
|
+
toastStyle
|
|
2164
2169
|
],
|
|
2165
2170
|
testID: "TOAST"
|
|
2166
2171
|
},
|
|
2167
|
-
/* @__PURE__ */ React.createElement(View, { style: styles$l.toastContainer }, /* @__PURE__ */ React.createElement(View, { style: styles$l.innerContainer }, /* @__PURE__ */ React.createElement(Pressable, { onPress: hideToast }, isSuccess ? sucessIcon :
|
|
2172
|
+
/* @__PURE__ */ React.createElement(View, { style: styles$l.toastContainer }, /* @__PURE__ */ React.createElement(View, { style: styles$l.innerContainer }, /* @__PURE__ */ React.createElement(Pressable, { onPress: hideToast }, isSuccess ? sucessIcon : warning ? warningIcon : errorIcon), /* @__PURE__ */ React.createElement(
|
|
2168
2173
|
CustomTypography,
|
|
2169
2174
|
{
|
|
2170
2175
|
variant: "L2_REGULAR",
|
|
@@ -3775,7 +3780,7 @@ class ToastService {
|
|
|
3775
3780
|
setRef(ref) {
|
|
3776
3781
|
this.toastRef = ref;
|
|
3777
3782
|
}
|
|
3778
|
-
showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72) {
|
|
3783
|
+
showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false, tostContainerStyle = {}) {
|
|
3779
3784
|
if (this.toastRef) {
|
|
3780
3785
|
this.toastRef.showToast(
|
|
3781
3786
|
message,
|
|
@@ -3783,7 +3788,11 @@ class ToastService {
|
|
|
3783
3788
|
isSuccess,
|
|
3784
3789
|
buttonText,
|
|
3785
3790
|
buttonAction,
|
|
3786
|
-
height
|
|
3791
|
+
height,
|
|
3792
|
+
subText,
|
|
3793
|
+
subTextPress,
|
|
3794
|
+
warning,
|
|
3795
|
+
tostContainerStyle
|
|
3787
3796
|
);
|
|
3788
3797
|
}
|
|
3789
3798
|
}
|