How to use react-native-root-toast - 10 common examples

To help you get started, we’ve selected a few react-native-root-toast examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wheatandcat / Peperomia / PeperomiaNative / src / components / pages / Schedule / Switch.tsx View on Github external
}

    const linkID = await saveFirestore(userID, this.state.item, items);
    if (!linkID) {
      Alert.alert('保存に失敗しました');
      return;
    }

    const shareHost = 'https://peperomia.info';
    console.log(`${shareHost}/${linkID}`);

    Clipboard.setString(`${shareHost}/${linkID}`);

    const { height } = Dimensions.get('window');

    const toast = Toast.show('リンクがコピーされました!', {
      duration: Toast.durations.LONG,
      position: height - 150,
      shadow: true,
      animation: true,
      hideOnPress: true,
      delay: 0,
    });

    // You can manually hide the Toast, or it will automatically disappear after a `duration` ms timeout.
    setTimeout(function() {
      Toast.hide(toast);
    }, 3000);
  };
github juliancorrea / react-native-redux-thunk-login / src / container / LoginContainer / index.js View on Github external
checkError(){
		if (this.props.hasError){
			const error = this.props.lastError.message;
			let message = i18n.t("login_validationMessage");
			console.log(error);
			// Add a Toast on screen.
		Toast.show(message, {
			duration: Toast.durations.SHORT,
			position: Toast.positions.BOTTOM,
			shadow: true,
			animation: true,
			hideOnPress: true,
			onHidden: () => {
				this.props.resetLoginControlVars();
			}
		});
		}
	}
	render() {
github wheatandcat / Peperomia / PeperomiaNative / src / components / pages / Schedule / Switch.tsx View on Github external
onCloseShareLink = async (doc: string) => {
    const result = await updateShare(doc, false);
    if (result) {
      const { height } = Dimensions.get('window');

      let toast = Toast.show('リンクを非公開にしました', {
        duration: Toast.durations.LONG,
        //textColor: "red",
        position: height - 150,
        shadow: true,
        animation: true,
        hideOnPress: true,
        delay: 0,
      });

      // You can manually hide the Toast, or it will automatically disappear after a `duration` ms timeout.
      setTimeout(function() {
        Toast.hide(toast);
      }, 3000);
    }
  };
github wheatandcat / Peperomia / PeperomiaNative / src / components / pages / Schedule / Switch.tsx View on Github external
onCloseShareLink = async (doc: string) => {
    const result = await updateShare(doc, false);
    if (result) {
      const { height } = Dimensions.get('window');

      let toast = Toast.show('リンクを非公開にしました', {
        duration: Toast.durations.LONG,
        //textColor: "red",
        position: height - 150,
        shadow: true,
        animation: true,
        hideOnPress: true,
        delay: 0,
      });

      // You can manually hide the Toast, or it will automatically disappear after a `duration` ms timeout.
      setTimeout(function() {
        Toast.hide(toast);
      }, 3000);
    }
  };
github transistorsoft / rn-background-geolocation-demo / components / lib / SettingsService.js View on Github external
toast(message, param, duration) {
    duration = duration || 'LONG';
    // Add a Toast on screen.
    let toast = Toast.show(message, {
      duration: Toast.durations[duration.toUpperCase()],
      position: Toast.positions.BOTTOM,
      shadow: true,
      animation: true,
      hideOnPress: true,
      delay: 0
    });
  }
github t880216t / buger / app / containers / Login.js View on Github external
duration: Toast.durations.SHORT,
        position: Toast.positions.CENTER,
      })
      return
    }
    if (/^[\u3220-\uFA29]+$/.test(userName)) {
      Toast.show('账号请输入英文字符', {
        duration: Toast.durations.SHORT,
        position: Toast.positions.CENTER,
      })
      return
    }
    if (!this.state.domain) {
      Toast.show('域名不可空!', {
        duration: Toast.durations.SHORT,
        position: Toast.positions.CENTER,
      })
      return
    }
    if (!userName) {
      Toast.show('账号不可空!', {
        duration: Toast.durations.SHORT,
        position: Toast.positions.CENTER,
      })
      return
    }
    if (!password) {
      Toast.show('密码不可空!', {
        duration: Toast.durations.SHORT,
        position: Toast.positions.CENTER,
      })
      return
github believeitcould / HelloRN / src / tabs / music / music.js View on Github external
onError={(e) => {
							console.log(e)
							Toast.show('mp3资源出错',{
								position: Toast.positions.CENTER,
								onHidden: () => {
									let index = this.state.songs.indexOf(this.state.currentSong)
									index = index == this.state.songs.length-1 ? 0 : index+1
									this.setState({
										currentSong: this.state.songs[index],
										sliderValue: 0,
										current: '00:00',
									})
								}
							})
						}}
					/>
github gaoxiaosong / react-native-im / plugin / setting / GroupName.tsx View on Github external
.catch(() => {
                Toast.show(i18n.t('IMToastError', {
                    action: i18n.t('IMSettingGroupNameChange'),
                }));
            });
    }
github wangdicoder / react-native-Gank / js / actions / requestHomeData.js View on Github external
dao.fetchLocalData(date).then((localData) => {
            Toast.show('已是最新数据了', {position: px2dp(-80)});
            dispatch(receiveData(localData, date));
        }, (localData)=>{
            fetchWithTimeout(5000, fetch(url))
github gaoxiaosong / react-native-im / standard / page / ChatDetail.tsx View on Github external
.then(() => {
                if (isCurrent) {
                    this._markAllRead();
                } else {
                    Toast.show(i18n.t('IMToastSuccess', {
                        action: i18n.t('IMCommonSendMessage')
                    }));
                }
            })
            .catch(() => {

react-native-root-toast

react native toast like component, pure javascript solution

MIT
Latest version published 7 months ago

Package Health Score

72 / 100
Full package analysis