How to use react-native-flash-message - 9 common examples

To help you get started, we’ve selected a few react-native-flash-message 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 MetaMask / metamask-mobile / app / core / PaymentChannelsClient.js View on Github external
const newInternalTxs = this.handleInternalTransactions(newStatus.txHash);
					Engine.context.TransactionController.update({ internalTransactions: newInternalTxs });
					this.setState({ withdrawalPending: false, withdrawalPendingValue: undefined });
				}
			}
		}

		if (newStatus.type !== status.type) {
			newStatus.reset = true;
			if (newStatus.type && newStatus.type !== 'DEPOSIT_PENDING') {
				const notification_type = newStatus.type
					.toLowerCase()
					.split('_')
					.reverse()
					.join('_');
				hideMessage();
				setTimeout(() => {
					TransactionsNotificationManager.showInstantPaymentNotification(notification_type);
				}, 300);
			}
		}
		this.setState({ status: newStatus });
	}
github lucasferreira / react-native-flash-message / examples / FlashMessagePlayground / screens / MainScreen.js View on Github external
showSimpleMessage(type = "default", props = {}) {
    const message = {
      message: "Some message title",
      description: "Lorem ipsum dolar sit amet",
      icon: { icon: "auto", position: "left" },
      type,
      ...props,
    };

    showMessage(message);
  }
  messageWithPosition(position = "top", hasDescription = true, extra = {}) {
github lucasferreira / react-native-flash-message / examples / FlashMessagePlayground / screens / MainScreen.js View on Github external
messageWithPosition(position = "top", hasDescription = true, extra = {}) {
    let message = {
      message: "Some message title",
      type: "info",
      position,
      ...extra,
    };

    if (hasDescription) {
      message = { ...message, description: "Lorem ipsum dolar sit amet" };
    } else {
      message = { ...message, floating: true };
    }

    showMessage(message);
  }
  render() {
github berty / berty / client / react-native / app / view / screen / Settings / Notifications.js View on Github external
async updateConfig() {
    try {
      const config = {
        ...this.props.config,
        notificationsEnabled: this.state.notificationsEnabled,
        notificationsPreviews: this.state.notificationsPreviews,
      }

      await this.props.context.mutations.configUpdate(config)
    } catch (e) {
      showMessage({
        message: String(e),
        type: 'danger',
        icon: 'danger',
        position: 'top',
      })

      this.setState({
        notificationsEnabled: this.getCurrentConfig().notificationsEnabled,
        notificationsPreviews: this.getCurrentConfig().notificationsPreviews,
      })
    }
  }
github berty / berty / client / react-native / app / view / screen / Settings / Devtools / Notifications.js View on Github external
async updateConfig (field) {
    try {
      const config = {
        ...this.props.config,
        [field]: this.state.config[field],
      }

      await this.props.context.node.service.configUpdate(config)
    } catch (e) {
      showMessage({
        message: String(e),
        type: 'danger',
        icon: 'danger',
        position: 'top',
      })
    }
  }
}
github MetaMask / metamask-mobile / app / core / TransactionsNotificationManager.js View on Github external
const id = (data && data.message && data.message.transaction && data.message.transaction.id) || null;

			const extraData = { action: 'tx', id };
			if (Platform.OS === 'android') {
				pushData.tag = JSON.stringify(extraData);
			} else {
				pushData.userInfo = extraData;
			}
			PushNotification.localNotification(pushData);

			if (id) {
				this._transactionToView.push(id);
			}
		} else {
			showMessage(data);
		}
	}
github zeckdude / react-native-expo-firebase-chat / src / components / screens / Login.js View on Github external
componentDidMount() {
    const messageProps = get(this.props, 'navigation.state.params.messageProps');
    if (messageProps) {
      const { title, body, type } = messageProps;

      showMessage({
        message: title,
        description: body,
        type,
      });
    }
  }
github lucasferreira / react-native-flash-message / examples / FlashMessagePlayground / screens / MainScreen.js View on Github external
label="Hide Status (iOS)"
                onPress={() =>
                  showMessage({
                    message: "Message that hide your status bar",
                    description: "Cool, uhm?",
                    type: "success",
                    hideStatusBar: true,
                  })
                }
              />
               hideMessage()} />

react-native-flash-message

React Native flashbar and top notification alert utility

MIT
Latest version published 9 months ago

Package Health Score

64 / 100
Full package analysis