dhre-ui-kit 0.0.263 → 0.0.265
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 +0 -1
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +5 -4
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -371,7 +371,6 @@ declare const _default$g: (props: AccordionProps) => React$1.JSX.Element;
|
|
|
371
371
|
interface ToastProps {
|
|
372
372
|
sucessIcon: React$1.ReactElement;
|
|
373
373
|
errorIcon: React$1.ReactElement;
|
|
374
|
-
containerStyle?: ViewStyle;
|
|
375
374
|
}
|
|
376
375
|
interface ToastRef {
|
|
377
376
|
showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null) => void;
|
package/lib/index.js
CHANGED
|
@@ -2078,7 +2078,6 @@ const styles$l = reactNative.StyleSheet.create({
|
|
|
2078
2078
|
container: {
|
|
2079
2079
|
position: "absolute",
|
|
2080
2080
|
alignSelf: "center",
|
|
2081
|
-
height: verticalScale(72),
|
|
2082
2081
|
width: width - horizontalScale(32),
|
|
2083
2082
|
top: 56,
|
|
2084
2083
|
borderRadius: moderateScale(8),
|
|
@@ -2109,20 +2108,22 @@ const styles$l = reactNative.StyleSheet.create({
|
|
|
2109
2108
|
});
|
|
2110
2109
|
|
|
2111
2110
|
const Toast = React__default["default"].forwardRef(
|
|
2112
|
-
({ sucessIcon, errorIcon
|
|
2111
|
+
({ sucessIcon, errorIcon }, ref) => {
|
|
2113
2112
|
const [visible, setVisible] = React.useState(false);
|
|
2114
2113
|
const [message, setMessage] = React.useState("");
|
|
2115
2114
|
const [isSuccess, setIsSuccess] = React.useState(true);
|
|
2116
2115
|
const [btnText, setBtnText] = React.useState(null);
|
|
2117
2116
|
const [onBtnPress, setOnBtnPress] = React.useState(null);
|
|
2118
2117
|
const [progress, setProgress] = React.useState(0);
|
|
2118
|
+
const [height, setHeight] = React.useState(72);
|
|
2119
2119
|
const bottom = React.useRef(new reactNative.Animated.Value(-80)).current;
|
|
2120
|
-
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null) => {
|
|
2120
|
+
const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72) => {
|
|
2121
2121
|
setMessage(toastMessage);
|
|
2122
2122
|
setIsSuccess(success);
|
|
2123
2123
|
setBtnText(buttonText);
|
|
2124
2124
|
setOnBtnPress(() => buttonAction);
|
|
2125
2125
|
setVisible(true);
|
|
2126
|
+
setHeight(height2);
|
|
2126
2127
|
reactNative.Animated.timing(bottom, {
|
|
2127
2128
|
toValue: 20,
|
|
2128
2129
|
duration: 500,
|
|
@@ -2162,7 +2163,7 @@ const Toast = React__default["default"].forwardRef(
|
|
|
2162
2163
|
styles$l.container,
|
|
2163
2164
|
{ bottom },
|
|
2164
2165
|
{ backgroundColor: isSuccess ? "#00B578" : "#EB0542" },
|
|
2165
|
-
|
|
2166
|
+
{ height: verticalScale(height) }
|
|
2166
2167
|
],
|
|
2167
2168
|
testID: "TOAST"
|
|
2168
2169
|
},
|