2.0.1-alpha.0 • Published 9 months ago

@cromwell/toolkit-commerce v2.0.1-alpha.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Commerce toolkit

A toolkit for building e-commerce websites with Cromwell CMS

Links

Install

npm i @cromwell/toolkit-commerce

Some components of this package use react-toastify. If you need notifications add ToastContainer into your custom app:

import React from 'react';
import { ToastContainer } from 'react-toastify';

export default function App() {
  return (
    <div>
      /* ... */
      <ToastContainer />
    </div>
  );
}

Add global CSS in cromwell.config.js:

module.exports = {
  globalCss: ['@cromwell/toolkit-commerce/dist/_index.css', 'react-toastify/dist/ReactToastify.css'],
};

Use

Example of usage of a component for product category:

import { MuiCategoryList } from '@cromwell/toolkit-commerce';
import React from 'react';

export default function CategoryPage() {
  return <MuiCategoryList />;
}

export const getStaticProps = MuiCategoryList.withGetProps();

List of components

HOCs

Material UI HOCs