How to use the react-native-root-toast.show 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 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 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 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(() => {
github eosiosg / pomelo / src / pages / PasswordInputPage / index.js View on Github external
onPasswordSet={( newPassword ) => {
                                    if ( newPassword === this.state.oldPassword ) {
                                        this._passwordInputPageItem1.blur();
                                        this._passwordInputPageItem2.blur();

                                        this.setPassword( newPassword );
                                    } else {
                                        Toast.show( I18n.t( 'Password Invalid' ), { position: Toast.positions.CENTER } );

                                        this._passwordInputPageItem1.clearPassword();
                                        this._passwordInputPageItem2.clearPassword();

                                        this._passwordInputPageItem2.blur();
                                        this._passwordInputPageItem1.focus();

                                        this.setState( {
                                            oldPassword: ''
                                        } );

                                        this._viewPager.setPage( 0 )
                                    }
                                }}
                            />
github EleTeam / Shop-React-Native / app / pages / AddressCreatePage.js View on Github external
InteractionManager.runAfterInteractions(() => {
            const {addressReducer} = this.props;
            if (addressReducer.isToasting) {
                Toast.show(addressReducer.message, {position:Toast.positions.CENTER});
            }
        });
    }
github eosiosg / pomelo / src / pages / ClaimRewardsPage / reducer.js View on Github external
export default function ClaimRewardsReducer (state = initState, action) {
    switch (action.type) {
        case "CLAIM_ONGOING_REDUCER":
            return Object.assign({}, state, {
                "isClaiming": true
            });
        case "CLAIM_SUCCESS_REDUCER":
            Toast.show('Claim Success',{
                position: 36,
            });
            return Object.assign({}, state, {
                "isClaiming": false
            });
        case "CLAIM_FAIL_REDUCER":
            Toast.show('Claim Failed',{
                position: 36,
            });
            return Object.assign({}, state, {
              "isClaiming": false
            });

        default:
            return state;
    }
github gaoxiaosong / react-native-im / plugin / setting / LeaveGroup.tsx View on Github external
props: Typings.Action.Setting.Params,
    text: string,
    isOwner: boolean
): Promise {
    const {imId, navigation} = props;
    try {
        if (isOwner) {
            await Delegate.model.Group.destroyOne(imId);
        } else {
            await Delegate.model.Group.quitOne(imId);
        }
        Toast.show(i18n.t('IMToastSuccess', {action: text}));
        const action = StackActions.pop({n: 2});
        navigation.dispatch(action);
    } catch (err) {
        Toast.show(i18n.t('IMToastError', {action: text}));
    }
}
github eosiosg / pomelo / src / pages / PasswordInputPage / index.js View on Github external
setPassword( password ) {
        if ( password.length !== 6 ) {
            Toast.show( "Password length is not correctly" );

            return;
        }

        setStorageAESKey( password );

        storage.save( {
            key: 'PasswordInputPage',
            data: encryptObjectToString( {
                passwordCheck: "passwordCheck",
            } ),
        } ).then( () => {
            setIsSetLocalStorageAESKey( true );

            this.props.navigation.goBack();
            Toast.show( I18n.t( "Password Set Success" ) );

react-native-root-toast

react native toast like component, pure javascript solution

MIT
Latest version published 6 months ago

Package Health Score

72 / 100
Full package analysis