How to use the cozy-ui/transpiled/react/Alerter.info function in cozy-ui

To help you get started, we’ve selected a few cozy-ui 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 cozy / cozy.github.io / en / cozy-banks / src / ducks / mobile / push.js View on Github external
const handleNotification = notification => {
  if (notification.additionalData.foreground && isIOS()) {
    // on iOS the the notification does not appear if the application is in foreground
    Alerter.info(notification.title + ' : ' + notification.message)
  }
  if (flag('debug')) {
    // eslint-disable-next-line no-console
    console.log('Received notification', notification)
  }
  if (
    !notification.additionalData.foreground &&
    notification.additionalData.route
  ) {
    hashHistory.push(notification.additionalData.route)
  }
}
github cozy / cozy.github.io / en / cozy-banks / src / ducks / settings / AppVersion.jsx View on Github external
handleClick() {
    this.clicks.push({ date: Date.now() })
    this.clicks = takeLast(this.clicks, 3)
    if (this.clicks.length < 3) {
      return
    }
    for (const [prevClick, click] of pairs(this.clicks)) {
      const delta = click.date - prevClick.date
      if (delta > 1000) {
        // Clicks are not close enough
        return
      }
    }
    Alerter.info('Debug flag activated')
    flag('debug', true)
  }
github cozy / cozy.github.io / en / cozy-banks / src / main.jsx View on Github external
const onStartOrResume = checkToRefreshToken(client, store, () => {
      if (flag('debug')) {
        Alerter.info('Token refreshed')
      }
    })
    document.addEventListener('deviceready', onStartOrResume)
github cozy / cozy.github.io / en / cozy-banks / src / ducks / pin / PinAuth.jsx View on Github external
handleEnteredPin(pinValue) {
    if (this.cleaning) {
      return
    }
    const { pinSetting, t } = this.props
    const pinDoc = pinSetting.data
    if (!pinDoc) {
      Alerter.info(t('Pin.no-pin-configured'))
      return this.props.onSuccess()
    }

    this.setState({ pinValue })

    if (pinValue === pinDoc.pin) {
      this.setState({ success: true })
      this.props.onSuccess()
      return
    }

    if (pinValue.length === this.props.maxLength) {
      const newAttempt = this.state.attempt + 1
      if (newAttempt >= this.props.maxAttempt) {
        return this.onMaxAttempt()
      }
github cozy / cozy.github.io / en / cozy-banks / src / ducks / pin / PinAuth.jsx View on Github external
handleFingerprintError() {
    const { t } = this.props.t
    Alerter.info(t('Pin.bad-pin'))
  }