calintamas / react-native-toast-message

Animated toast message component for React Native
MIT License
1.6k stars 252 forks source link

Toasts should not move. How to stop moving? #518

Open harika-zazz opened 7 months ago

harika-zazz commented 7 months ago

Describe the bug Hi, i am using this module. It is working fine but toasts are moving down. How to stop?

Steps to reproduce Steps to reproduce the behavior: Toasts are moving

Expected behavior Toasts should not move . It should be fixed in top.

Screenshots Screenshot 2023-12-15 at 6 04 48 PM

seyedmostafahasani commented 6 months ago

@harika-zazz It continues until a certain position and then stops?

harika-zazz commented 6 months ago

Hi @seyedmostafahasani, thanks for your reply. It is moving to bottom of the screen. The toast should be fixed on top without dragging anywhere is the screen. How to implement or any solution?

seyedmostafahasani commented 6 months ago

@harika-zazz Are you sure you implemented it like as documented?

harika-zazz commented 6 months ago

Yes @seyedmostafahasani

seyedmostafahasani commented 6 months ago

@harika-zazz I couldn't reproduce your problem. Can you share your code?

harika-zazz commented 6 months ago

Hi @seyedmostafahasani Here is the code:-

In App.tsx

import toastConfig from "./src/utils/toastConfig";

return(
<>
<Navigation />
  <Toast config={toastConfig} />
</>
)

In toastConfig.tsx

import { BaseToast, ErrorToast } from 'react-native-toast-message';

const toastConfig = {
  /*
      Overwrite 'success' type,
      by modifying the existing `BaseToast` component
    */
  success: props => (
    <BaseToast
      {...props}
      style={{ borderLeftColor: '#42ba96' }}
      contentContainerStyle={{ paddingHorizontal: 15 }}
      text1Style={{
        fontSize: scaler(14),
        fontWeight: '400',
        fontFamily: "Poppins-Regular"
      }}
      text2Style={{
        fontSize: scaler(12),
        color: 'black',
        opacity: 0.5,
        fontFamily: "Poppins-Regular"
      }}
      text2NumberOfLines={5}
    />
  ),
  /*
      Overwrite 'error' type,
      by modifying the existing `ErrorToast` component
    */
  error: props => (
    <ErrorToast
      {...props}
      text1Style={{
        fontSize: scaler(14),
        // fontWeight: '400',
        fontFamily: "Poppins-Regular"
      }}

      text2Style={{
        fontSize: scaler(12),
        color: 'black',
        opacity: 0.5,
        fontFamily: "Poppins-Regular"

      }}
      text2NumberOfLines={5}
      style={{
        minHeight: scaler(70),
        borderLeftColor: 'red',
        // paddingVertical:scaler(20)

        // paddingBottom:scaler(5)
      }}

    />
  ),
};

export default toastConfig;