Giter Site home page Giter Site logo

Comments (5)

arnnis avatar arnnis commented on July 30, 2024 4

This should be fixed in the new version 3.4.0

from react-native-toast-notifications.

algarcia-vector avatar algarcia-vector commented on July 30, 2024

I was able to fix this problem by double wrapping first a SafeAreaView then a View, both with flex: 1 finally the ToastProvider.

it's working like this:

export function Navigation() {
  const {accessToken} = useSelector((state: RootState) => state.login);
  return (
    <SafeAreaView style={{flex: 1}}>
      <View style={{flex: 1}}>
        <ToastProvider
          renderType={{
            success: toast => (
              <View style={styles.subMainContainer}>
                <View style={styles.topContainer}>
                  <View style={styles.leftContainer}>
                    <SuccessfullAlertIcon />
                  </View>
                  <View style={styles.rightContainer}>
                    <View style={styles.titleContainer}>
                      <View style={styles.positionTitle}>
                        <Text style={styles.titleText}>{toast.data}</Text>
                      </View>
                      <TouchableOpacity
                        style={styles.iconContainer}
                        onPress={() => {
                          toast.onHide();
                        }}>
                        <BlackCrossIcon />
                      </TouchableOpacity>
                    </View>
                    <View style={styles.subTitleContainer}>
                      <Text style={styles.message}>{toast.message}</Text>
                    </View>
                  </View>
                </View>
              </View>
            ),
          }}>
          {!accessToken ? <LoginStack /> : <MainStack />}
        </ToastProvider>
      </View>
    </SafeAreaView>
  );
}

from react-native-toast-notifications.

eleversa avatar eleversa commented on July 30, 2024

This solution has not worked for me. Has anyone managed to make the top toast look correctly in ios?

from react-native-toast-notifications.

donaldkwong avatar donaldkwong commented on July 30, 2024

I got it to render correctly by first using react-native-safe-area-context to get the safe top and bottom insets and then using those insets as values for the offsetTop and offsetBottom properties of the ToastContainer.

from react-native-toast-notifications.

eleversa avatar eleversa commented on July 30, 2024

@donaldkwong This sounds good. Finally, I have solved it using this fork:#167 (fix safeareaview issue with toast notifications on notch devices)

from react-native-toast-notifications.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.