How to use the react-native-root-toast.positions function in react-native-root-toast

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 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 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 odota / mobile / app / components / PlayerCard.js View on Github external
duration: Toast.durations.SHORT,
                    position: Toast.positions.BOTTOM,
                    shadow: true,
                    animation: true,
                    hideOnPress: true,
                    delay: 0
                });
                setTimeout(function () {
                    Toast.hide(toast);
                }, 2000);
            } else {
                this.props.tracker.trackEvent('Favourites', 'Removed');
                this.props.favouritesActions.removeFavourites(info.account_id);
                let toast = Toast.show('Removed from Favourites', {
                    duration: Toast.durations.SHORT,
                    position: Toast.positions.BOTTOM,
                    shadow: true,
                    animation: true,
                    hideOnPress: true,
                    delay: 0
                });
                setTimeout(function () {
                    Toast.hide(toast);
                }, 2000);
            }

            setTimeout(() => {
                var favouritesString = JSON.stringify(this.props.favourites);
                AsyncStorage.setItem("favourites", favouritesString);
            }, 1000);
        }
github t880216t / buger / app / utils / request.js View on Github external
const timer = setTimeout(() => {
    Loading.hidden()
    Toast.show('请求超时,请烧后重试!', {
      duration: Toast.durations.SHORT,
      position: Toast.positions.CENTER,
    })
  }, 30000)
github misnet / react-native-shop / src / page / Index.js View on Github external
BackAndroid.addEventListener('hardwareBackPress', (()=> {
        let routes = _navigator.getCurrentRoutes();
        if (routes.length>0) {
            _navigator.pop();
            if(routes.length==2){
                Toast.show(Di18n.tr('再按一次退出程序'),{
                    duration:Toast.durations.SHORT,
                    position:Toast.positions.CENTER,
                    animation:true
                });
            }else if(routes.length==1){
                BackAndroid.exitApp();
            }
            return true;
        }else{
            return false;
        }
    }));
}
github EleTeam / Shop-React-Native / app / pages / RegisterPage.js View on Github external
_register(){
        let {mobile, password, code} = this.state;

        if (!mobile.length) {
            Toast.show('请输入正确的手机号', {position:Toast.positions.CENTER});
            return;
        }
        if (password.length < 6) {
            Toast.show('密码必须大于6位', {position:Toast.positions.CENTER});
            return;
        }
        if (!code.length) {
            Toast.show('请输入验证码', {position:Toast.positions.CENTER});
            return;
        }

        InteractionManager.runAfterInteractions(() => {
            const {dispatch} = this.props;
            dispatch(userRegister(mobile, password, code));
        });
    };
github guangqiang-liu / OneM / src / utils / toast / index.js View on Github external
showWarning: (msg, options) => {
    let toast = RootToast.show(
      Platform.OS === 'ios' ?
         : msg, {
        duration: RootToast.durations.SHORT,
        position: RootToast.positions.CENTER,
        ...options,
      })
    setTimeout(function () {
      RootToast.hide(toast)
    }, RootToast.durations.SHORT + 500)
  },
github t880216t / buger / app / containers / AddPage.js View on Github external
})
          this.setState(
            {
              fixVersions:
                formatFixVersions.length > 0 ? formatFixVersions : null,
              projectData: value,
              customItems: customItems.length === 0 ? null : customItems,
              subCustomItems: subCustomItems,
            },
            () => this.searchAssignee('')
          )
        } else {
          Loading.hidden()
          Toast.show('该项目信息异常,请检查配置!', {
            duration: Toast.durations.SHORT,
            position: Toast.positions.CENTER,
          })
        }
      })
  }
github EleTeam / Shop-React-Native / app / pages / LoginPage.js View on Github external
_login(){
        let {mobile, password} = this.state;

        if (!mobile.length) {
            Toast.show('请输入正确的手机号', {position:Toast.positions.CENTER});
            return;
        }
        if (!password.length) {
            Toast.show('请输入密码', {position:Toast.positions.CENTER});
            return;
        }

        InteractionManager.runAfterInteractions(() => {
            const {dispatch} = this.props;
            dispatch(userLogin(mobile, password));
        });
    }

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