5.0.0-alpha.6 • Published 5 years ago

@b2bfinance/products-embed v5.0.0-alpha.6

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Products Embed

Storybook Travis npm package Coveralls

Display a list of products.

Installation

// with npm
npm install @b2bfinance/products-embed

// with yarn
yarn add @b2bfinance/products-embed

Usage

import React from "react";
import ReactDOM from "react-dom";
import { ThemeProvider } from "@material-ui/styles";
import { EmbedWrapper, theme } from "@b2bfinance/products-embed";

function App() {
  return (
    <ThemeProvider theme={theme}>
      <EmbedWrapper
        products={[]}
        productsLimit={10}
        filters={[]}
        cta={"Get Deal"}
        provider={null}
        onMoreDetails={null}
        onApply={null}
      />
    </ThemeProvider>
  );
}

ReactDOM.render(<App />, document.querySelector("#app"));

Products

Products must be an array of objects matching the Product type below.

type Product = {
  id: String;
  type: String;
  issuer: String;
  title: String;
  brand: String;
  product: String;
  description: String;
  highlighted: Boolean;
  labels: String[];
  columns: {
    label: String;
    value: String;
  }[];
  detailed: {
    title: String;
    rows: {
      label: String;
      value: String;
    }[];
  }[];
  feature_point: String;
  links: {
    apply: String;
    logo: String;
  };
  meta: {
    faded: Boolean;
    confirm: {
      description: String;
      heading: String;
    };
  };
};

Filters

Filters must be an array of objects matching the Filter type below.

type Filter = {
  title: String;
  key: String;
  multiChoice: Boolean;
  selected: String[];
  choices: {
    label: String;
    value: String;
  }[];
};
5.0.0-alpha.6

5 years ago

5.0.0-alpha.5

5 years ago

5.0.0-alpha.4

5 years ago

5.0.0-alpha.3

5 years ago

5.0.0-alpha.2

5 years ago

5.0.0-alpha.1

5 years ago