dhre-ui-kit 0.0.305 → 0.0.306

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 CHANGED
@@ -379,10 +379,10 @@ interface ToastProps {
379
379
  warningIcon: React$1.ReactElement;
380
380
  }
381
381
  interface ToastRef {
382
- showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean, tostContainerStyle?: ViewStyle) => void;
382
+ showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean) => void;
383
383
  }
384
384
  interface ToastRef {
385
- showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean, tostContainerStyle?: ViewStyle) => void;
385
+ showToast: (message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean) => void;
386
386
  }
387
387
  interface ToastServiceInterface {
388
388
  setRef: (ref: ToastRef | null) => void;
@@ -679,7 +679,7 @@ declare const CustomSwitchBtn: ({ value, onValueChange, disabled, activeText, ac
679
679
  declare class ToastService implements ToastServiceInterface {
680
680
  private toastRef;
681
681
  setRef(ref: ToastRef | null): void;
682
- showToast(message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean, tostContainerStyle?: ViewStyle): void;
682
+ showToast(message: string, duration?: number, isSuccess?: boolean, buttonText?: string | null, buttonAction?: (() => void) | null, height?: number, subText?: string | null, subTextPress?: (() => void) | null, warning?: boolean): void;
683
683
  }
684
684
  declare const toastService: ToastService;
685
685
 
package/lib/index.js CHANGED
@@ -2127,7 +2127,8 @@ const styles$l = reactNative.StyleSheet.create({
2127
2127
  color: "#fff"
2128
2128
  },
2129
2129
  subContainer: {
2130
- paddingHorizontal: horizontalScale(12)
2130
+ paddingHorizontal: horizontalScale(20),
2131
+ marginTop: verticalScale(8)
2131
2132
  },
2132
2133
  subButtonText: {
2133
2134
  textDecorationLine: "underline",
@@ -2145,12 +2146,13 @@ const Toast = React__default["default"].forwardRef(
2145
2146
  const [onBtnPress, setOnBtnPress] = React.useState(null);
2146
2147
  const [progress, setProgress] = React.useState(0);
2147
2148
  const [height, setHeight] = React.useState(72);
2148
- const [onSubBtnPress, setOnSubBtnPress] = React.useState(null);
2149
+ const [onSubBtnPress, setOnSubBtnPress] = React.useState(
2150
+ null
2151
+ );
2149
2152
  const [subjectText, setSubjectText] = React.useState(null);
2150
2153
  const [warning, setWarning] = React.useState(false);
2151
- const [toastStyle, setToastStyle] = React.useState();
2152
2154
  const bottom = React.useRef(new reactNative.Animated.Value(-80)).current;
2153
- const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false, tostContainerStyle) => {
2155
+ const showToast = (toastMessage, duration = 3e3, success = true, buttonText = null, buttonAction = null, height2 = 72, subText = null, subTextPress = null, warning2 = false) => {
2154
2156
  setMessage(toastMessage);
2155
2157
  setIsSuccess(success);
2156
2158
  setBtnText(buttonText);
@@ -2160,7 +2162,6 @@ const Toast = React__default["default"].forwardRef(
2160
2162
  setSubjectText(subText);
2161
2163
  setOnSubBtnPress(() => subTextPress);
2162
2164
  setWarning(warning2);
2163
- setToastStyle(tostContainerStyle);
2164
2165
  reactNative.Animated.timing(bottom, {
2165
2166
  toValue: 20,
2166
2167
  duration: 500,
@@ -2200,8 +2201,7 @@ const Toast = React__default["default"].forwardRef(
2200
2201
  styles$l.container,
2201
2202
  { bottom },
2202
2203
  { backgroundColor: isSuccess ? "#00B578" : "#EB0542" },
2203
- { height: verticalScale(height) },
2204
- toastStyle
2204
+ { height: verticalScale(height) }
2205
2205
  ],
2206
2206
  testID: "TOAST"
2207
2207
  },
@@ -2227,8 +2227,7 @@ const Toast = React__default["default"].forwardRef(
2227
2227
  style: styles$l.buttonText
2228
2228
  }
2229
2229
  )
2230
- ))),
2231
- subjectText && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$l.subContainer }, /* @__PURE__ */ React__default["default"].createElement(
2230
+ )), subjectText && /* @__PURE__ */ React__default["default"].createElement(reactNative.View, { style: styles$l.subContainer }, /* @__PURE__ */ React__default["default"].createElement(
2232
2231
  reactNative.Pressable,
2233
2232
  {
2234
2233
  style: styles$l.button,
@@ -2243,7 +2242,7 @@ const Toast = React__default["default"].forwardRef(
2243
2242
  style: styles$l.subButtonText
2244
2243
  }
2245
2244
  )
2246
- )),
2245
+ ))),
2247
2246
  /* @__PURE__ */ React__default["default"].createElement(
2248
2247
  Progress__namespace.Bar,
2249
2248
  {
@@ -3816,7 +3815,7 @@ class ToastService {
3816
3815
  setRef(ref) {
3817
3816
  this.toastRef = ref;
3818
3817
  }
3819
- showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false, tostContainerStyle = {}) {
3818
+ showToast(message, duration = 3e3, isSuccess = true, buttonText = null, buttonAction = null, height = 72, subText = null, subTextPress = null, warning = false) {
3820
3819
  if (this.toastRef) {
3821
3820
  this.toastRef.showToast(
3822
3821
  message,
@@ -3827,8 +3826,7 @@ class ToastService {
3827
3826
  height,
3828
3827
  subText,
3829
3828
  subTextPress,
3830
- warning,
3831
- tostContainerStyle
3829
+ warning
3832
3830
  );
3833
3831
  }
3834
3832
  }