How to use the react-native-root-toast.durations 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
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 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 odota / mobile / app / components / PeersCard.js View on Github external
onFavouritePressed(accountId, personaName, avatar) {
        var index = -1;
        for(let i = 0; i < this.props.favourites.length; i++) {
            if(this.props.favourites[i].account_id == accountId) {
                index = i;
            }
        }
        if(index == -1) {
            var info = {};
            info.account_id = accountId;
            info.avatarfull = avatar;
            info.personaname = personaName;
            this.props.favouritesActions.addFavourites(info);
            let toast = Toast.show('Added to Favourites', {
                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.favouritesActions.removeFavourites(accountId);
            let toast = Toast.show('Removed from Favourites', {
                duration: Toast.durations.SHORT,
                position: Toast.positions.BOTTOM,
                shadow: true,
                animation: true,
github search-future / miyou.tv / src / utils / init / index.web.ts View on Github external
function dispatchWindow(action: AnyAction) {
  try {
    const win = remote.getCurrentWindow();
    const data = JSON.stringify(action);
    win.webContents.send("dispatch", data);
  } catch (e) {
    Toast.show(e.message || JSON.stringify(e, null, 2), {
      ...toastOptions,
      duration: Toast.durations.SHORT
    });
  }
}
github wuyanwuyan / react_native_app_start_kit / src / utils / ToastUtil.js View on Github external
const showLong = (content) => {
    if (!content) {
        return;
    }
    if (Platform.OS === 'ios') {
        Toast.show(content.toString(), {
            duration: Toast.durations.LONG,
            position: Toast.positions.BOTTOM,
            shadow: true,
            animation: true,
            hideOnPress: true,
            delay: 0,
        });
    } else {
        ToastAndroid.show(content.toString(), ToastAndroid.LONG);
    }
};
github seawind8888 / Nobibi / app / common / ToastUtil.js View on Github external
export const toastLong = (content) => {
  if (toast !== undefined) {
    Toast.hide(toast);
  }
  toast = Toast.show(content.toString(), {
    duration: Toast.durations.LONG,
    position: Toast.positions.BOTTOM,
    shadow: true,
    animation: true,
    hideOnPress: true,
    delay: 0
  });
};
github t880216t / buger / app / containers / AddPage.js View on Github external
Toast.show('标题不可为空!', {
        duration: Toast.durations.SHORT,
        position: Toast.positions.CENTER,
      })
      return
    }
    if (!this.state.description) {
      Toast.show('描述不可为空!', {
        duration: Toast.durations.SHORT,
        position: Toast.positions.CENTER,
      })
      return
    }
    if (!this.state.assigneeName) {
      Toast.show('请指定指给谁!', {
        duration: Toast.durations.SHORT,
        position: Toast.positions.CENTER,
      })
      return
    }
    let BaseParams = {}
    BaseParams = {
      fields: {
        issuetype: {
          name: 'Bug',
        },
        project: {
          key: this.state.projectData[0],
        },
        summary: this.state.summary,
        assignee: {
          name: this.state.assigneeName[0],
github RN-ONE / RNFrameWorkNew / app / component / ToastAI.js View on Github external
static showLongBottom(message) {
        let toast = Toast.show(message, {
            duration: Toast.durations.LONG,
            position: Toast.positions.BOTTOM,
            shadow: true,
            animation: true,
            textStyle: {
                fontSize: AppConfig.TEXT_SIZE_SMALL
            },
            hideOnPress: true,
            backgroundColor: BC,
            delay: 0,
            containerStyle: {
                paddingVertical: AppConfig.DISTANCE_SAFE / 2,
                paddingHorizontal: AppConfig.DISTANCE_SAFE,
                marginBottom: IphoneXUtil.isIphoneX() ? 50 + IphoneXUtil.iphoneXBottom() : 50,
            }
        });
    }
github wuyanwuyan / react_native_app_start_kit / src / utils / ToastUtil.js View on Github external
const showShort = (content) => {
    if (!content) {
        return;
    }
    if (Platform.OS === 'ios') {
        Toast.show(content.toString(), {
            duration: Toast.durations.SHORT,
            position: Toast.positions.BOTTOM,
            shadow: true,
            animation: true,
            hideOnPress: true,
            delay: 0,
        });
    } else {
        ToastAndroid.show(content.toString(), ToastAndroid.SHORT);
    }
};

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