1.0.0 • Published 3 years ago

react-native-cn-popup-modal v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
3 years ago

React-Native-popup-modal

Usage

<Root>
    <View>
        <TouchableOpacity
            onPress={() =>
              Popup.show({
              type: 'Survey', // Success, Survey, Danger, Warning
              /* image: require('./logo.png'), */  // optional
              title: 'New Survey',
              button: true,
              closebutton: true,
              closebuttonText: 'Close', // Default Close
              textBody: 'Would you like to participate in our survey ?',
              buttonText: 'Take the Survey',
              closeBtn: () => Popup.hide(),
              callback: () => {
                navigation.navigate("BusTime"),
                Popup.hide()
              }
            })
            }
        >
            <Text>Open Popup</Text>
        </TouchableOpacity>
    </View>
</Root>

Toast component

<Root>
    <View>
        <TouchableOpacity
            onPress={() => 
                    Toast.show({
                        type: 'Success', // Success, Warning, Danger
                        title: 'User created',
                        text: 'Your user was successfully created, use the app now.',
                        color: '#2ecc71'
                    })
          >
            <Text>Open Toast</Text>
        </TouchableOpacity>
    </View>
</Root>