Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
harika-zazz opened this issue Dec 15, 2023 · 6 comments
Open

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

harika-zazz opened this issue Dec 15, 2023 · 6 comments

Comments

@harika-zazz
Copy link

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
Copy link
Contributor

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

@harika-zazz
Copy link
Author

harika-zazz commented Dec 20, 2023

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
Copy link
Contributor

seyedmostafahasani commented Dec 21, 2023

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

@harika-zazz
Copy link
Author

Yes @seyedmostafahasani

@seyedmostafahasani
Copy link
Contributor

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

@harika-zazz
Copy link
Author

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants