8.0.0 • Published 2 years ago

@nacelle/react-dev-utils v8.0.0

Weekly downloads
220
License
ISC
Repository
github
Last release
2 years ago

@nacelle/react-dev-utils

React utility functions & TypeScript types for creating Nacelle projects

Install

With NPM

npm i @nacelle/react-dev-utils

Types

The majority of the types are generated from our GraphQL schemas using Graphql Code Gen. In addition, we extend this type for some of the frontend applcations, and this can be found in ./src/types/custom.

To generate new types manually, use npm run generate. You'll need the appropriate environment variables for this to be successful. Speak with someone on the dev team to get these if needed.

Fixtures

Useful mock data for writing tests.

  • shopifyItem: A typical Shopify item object
  • klaviyoItem: An item that has been used within a mock Klavyio store and can be used to see results for the Klaviyo Shopify integration

Utility Functions

formatCurrency()

Creates a function for formatting international currencies.

import { formatCurrency } from '@nacelle/react-dev-utils';

const formatPrice = formatCurrency('ja-JP', 'JPY');

const price = formatPrice(2744); // ¥2,744
8.0.0

2 years ago

6.1.0

2 years ago

6.0.2

2 years ago

7.0.0

2 years ago

6.0.1

2 years ago

6.0.0

3 years ago

5.0.0

3 years ago

4.0.0

3 years ago

3.0.0

3 years ago

2.10.1

3 years ago

2.10.0

3 years ago

2.9.0

3 years ago

2.9.0-alpha.0

3 years ago

2.8.1-alpha.0

3 years ago

2.8.0

4 years ago