How to use the native-base.Toast.show function in native-base

To help you get started, we’ve selected a few native-base 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 Cosecha / redadalertas / src / screens / Events / EventsMap.js View on Github external
async populateMap(newEvent) {
    try {
      await this.props.getEvents();
      if (this.props.errors.event) throw this.props.errors.event;
      if (newEvent) this.focusMarker(newEvent);
      Toast.show({
        buttonText: "OK",
        text: "Events fetched successfully.",
        type: "success"
      });
    } catch (error) {
      console.log("Error rendering map: ", error);
      Toast.show({
        buttonText: "OK",
        text: "Error rendering map.",
        type: "danger"
      });
    }
  }
github Space-Cowboy-2018 / AR-Shooter-FrontEnd / screens / AllRooms.js View on Github external
createRoom() {
    let navigate = this.props.navigation.navigate;
    if (this.state.name) {
      const roomName = this.state.name;
      const playerName = this.props.navigation.state.params.playerName;
      socket.emit(CREATE_ROOM, roomName, playerName);
      this.setState({ name: '' });
      navigate('Lobby', { room: this.state.name, playerName });
    } else {
      Toast.show({
        text: 'Please Enter Room Name!',
        buttonText: 'Okay'
      });
    }
  }
  handleChange(text) {
github Space-Cowboy-2018 / AR-Shooter-FrontEnd / screens / rooms.js View on Github external
createRoom() {
    if (this.state.name) {
      this.props.navigation.state.params.socket.emit(
        'createRoom',
        this.state.name
      );
      Toast.show({
        text: 'Room Created!',
        position: 'top',
        buttonText: 'Okay'
      });
    } else {
      Toast.show({
        text: 'Please Enter Room Name!',
        buttonText: 'Okay'
      });
    }
  }
  handleChange(text) {
github Cosecha / redadalertas / src / screens / Settings / ChangePassword.js View on Github external
}
      const response = await userServices.put(data);
      if (response instanceof Error) throw response;

      const loginResponse = await authServices.login({
        username: response.data.email,
        password: values.newPassword2
      });
      if (loginResponse instanceof Error) throw new Error("Error logging in with new password.");

      asyncStore.save("user", JSON.stringify(loginResponse));
      this.clearForm(resetForm);
      this.props.navigation.navigate("SettingsPage", {
        refresh: true
      });
      Toast.show({
        buttonText: "OK",
        text: "Password change successful.",
        type: "success"
      });
    } catch (error) {
      Toast.show({
        buttonText: "OK",
        text: "Error changing password: " + (error.message || error),
        type: "danger"
      });
    }
  };
github FE-Kits / fe-boilerplates / rn / webpack / src / container / LoginContainer / index.js View on Github external
login() {
		if (this.props.valid) {
			this.props.navigation.navigate("Drawer");
		} else {
			Toast.show({
				text: "Enter Valid Username & password!",
				duration: 2000,
				position: "top",
				textStyle: { textAlign: "center" },
			});
		}
	}
github walljser / community_e_commerce / src / screens / Home / ContentHeader.js View on Github external
fetchAdvs = async () => {
    try {
      const res = await advService.all()
      const advs = res.data.data
      this.setState({
        advs: advs
      })
    } catch(err) {
      Toast.show({
        text: '网络异常',
        position: 'top',
        type: 'danger'
      })
    }
  }
github GeekyAnts / react-native-boilerplate-mobx-state-tree-typescript / src / container / LoginContainer / index.tsx View on Github external
login() {
		this.props.loginForm.validateForm();
		if (this.props.loginForm.isValid) {
			this.props.loginForm.clearStore();
			this.props.navigation.navigate("Drawer");
		} else {
			Toast.show({
				text: "Enter Valid Email & password!",
				duration: 2000,
				position: "top",
				textStyle: { textAlign: "center" },
			});
		}
	}
	render() {
github Mangeneh / akkaskhooneh-frontend / src / pages / postInfo / PostInfo.js View on Github external
.catch((error) => {
          this.setState({ commentText: '' });
          Toast.show({
            text: strings(Strings.COMMENT_FAILED),
            textStyle: { textAlign: 'center' },
            position: 'bottom',
            type: 'danger',
          });
        });
    }