How to use the @influxdata/giraffe.binaryPrefixFormatter function in @influxdata/giraffe

To help you get started, we’ve selected a few @influxdata/giraffe 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 influxdata / influxdb / ui / src / shared / copy / notifications.ts View on Github external
import {binaryPrefixFormatter} from '@influxdata/giraffe'

// Types
import {Notification, NotificationStyle} from 'src/types'

// Constants
import {
  FIVE_SECONDS,
  TEN_SECONDS,
  FIFTEEN_SECONDS,
} from 'src/shared/constants/index'
import {QUICKSTART_SCRAPER_TARGET_URL} from 'src/dataLoaders/constants/pluginConfigs'
import {QUICKSTART_DASHBOARD_NAME} from 'src/onboarding/constants/index'
import {IconFont} from '@influxdata/clockface'

const bytesFormatter = binaryPrefixFormatter({
  suffix: 'B',
  significantDigits: 2,
  trimZeros: true,
})

type NotificationExcludingMessage = Pick<
  Notification,
  Exclude
>

const defaultErrorNotification: NotificationExcludingMessage = {
  style: NotificationStyle.Error,
  icon: IconFont.AlertTriangle,
  duration: TEN_SECONDS,
}

@influxdata/giraffe

[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://www.influxdata.com/slack)

MIT
Latest version published 2 years ago

Package Health Score

61 / 100
Full package analysis