0.19.1 • Published 2 months ago

@bolttech/molecules-success-card v0.19.1

Weekly downloads
-
License
-
Repository
-
Last release
2 months ago

Success Card Component

The SuccessCard component is a React component that displays a success card with information about a product, its details, and insured information.

Installation

To use the SuccessCard component, you need to install the required dependencies:

npm install @bolttech/frontend-foundations @bolttech/molecules-success-card

or

yarn add @bolttech/frontend-foundations @bolttech/molecules-success-card

Usage

You can use the SuccessCard component by importing it and including it in your JSX. Here's an example:

import React from 'react';
import { SuccessCard } from '@bolttech/molecules-success-card';
import { bolttechTheme, BolttechThemeProvider } from '@bolttech/frontend-foundations'; // Adjust the path to your component

const successCardContent = {
  title: 'Success!',
  productImg: 'path_to_image.png',
  productName: 'Product Name',
  productDescription: 'Product Description',
  contentValue: [
    {
      label: 'Coverage Label 1',
      value: '$1000',
      icon: 'check',
      included: true,
      breakLine: 'normal',
    },
    // Add more content items as needed
  ],
  dividerLabel: 'Insured Information',
  insuredInfo: [
    {
      icon: 'check',
      label: 'Insured Info 1',
    },
    // Add more insured info items as needed
  ],
};

function App() {
  return (
    <BolttechThemeProvider theme={bolttechTheme}>
      {/* SuccessCard component */}
      <SuccessCard {...successCardContent} dataTestId="example" />
    </BolttechThemeProvider>
  );
}

export default App;

Props

The SuccessCard component accepts the following props:

PropTypeDescription
dataTestIdstringThe data-testid attribute for testing purposes.
titlestringThe title to be displayed at the top of the card.
productImgstring orThe image URL or JSX element for the product image.
ReactNode
productNamestringThe name of the product.
productDescriptionstringThe description of the product.
contentValuearrayAn array of content items to be displayed.
dividerLabelstringThe label for the divider between content and insured information.
insuredInfoarrayAn array of insured information items.

Each contentValue and insuredInfo item should have the following structure:

{
  label: 'Label',
  value: 'Value',
  icon: 'icon_name', // Name of the icon from the @bolttech/atoms-icon library
  included: true, // Whether it's included or not (boolean)
  breakLine: 'normal', // Whether to display a line break after this item ('normal' or 'break-all' or undefined)
}

Functionality

The SuccessCard component provides the following functionality:

  • Display: Renders a success card with product information, content items, and insured information.
  • Customizable Content: Allows you to customize the title, product image, product name, product description, content items, and insured information.
  • Icon Display: Displays icons from the @bolttech/atoms-icon library.
  • Divider: Separates content and insured information with a customizable divider label.

Contribution

Contributions to the SuccessCard component are welcomed. If you encounter issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the component's Bitbucket repository.

0.19.1

2 months ago

0.0.1

4 months ago

0.19.0

6 months ago

0.11.0

9 months ago

0.10.1

10 months ago

0.12.0

9 months ago

0.13.0

9 months ago

0.14.0

9 months ago

0.15.0

8 months ago

0.16.0

8 months ago

0.17.0

6 months ago

0.18.0

6 months ago

0.17.1

6 months ago

0.10.0

10 months ago

0.3.0

10 months ago

0.2.0

10 months ago

0.9.0

10 months ago

0.5.0

10 months ago

0.1.4

10 months ago

0.4.0

10 months ago

0.1.3

10 months ago

0.7.0

10 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago