1.6.37 • Published 5 months ago

tapita-pagebuilder-react v1.6.37

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

tapita-pagebuilder-react

Tapita React PageBuilder Client

NPM JavaScript Style Guide

Install

npm install --save tapita-pagebuilder-react

Usage

import React, { Component } from 'react'

import { PageBuilderComponent } from 'tapita-pagebuilder-react'

class Example extends Component {
  render() {
    return <PageBuilderComponent endPoint={endPoint} maskedId={maskedId} />
  }
}

Develop

git clone https://github.com/TapitaCommerce/tapita-pagebuilder-react
cd tapita-pagebuilder-react
yarn install && cd example && yarn install && cd ..
yarn start

Then go to example directory, run another yarn start command.

Props

  • endPoint - String
  • maskedId - String
  • toPreview - Boolean
  • ProductList - ReactComponent - which would receive item data as props
  • ProductGrid - ReactComponent - which would receive item data as props
  • ProductScroll - ReactComponent - which would receive item data as props
  • CategoryScroll - ReactComponent - which would receive item data as props
  • Link - ReactComponent - For internal linking
  • history - Object - For history push inside pagebuilder component
  • formatMessage - Function - For Localization Purpose
  • lazyloadPlaceHolder - ReactComponent - Place holder for lazyload Image, if false/ no lazyload applied
  • overRender - Function - Function to override render function for each Item
  • layoutFilter - Int - Add filter to render the item: UNKNOWN: -1, PAGE_COMPONENT: 0, TOP: 1, BOTTOM: 2
  • filterRootChildrenOnly - Boolean - Only apply layoutFilter to highest level elements

usePbFinder

usePbFinder is a hook to help you find your page from the pages you created on Pagebuilder dashboard.

// storeCode is optional
const pbFinderProps = usePbFinder({
    endPoint,
    integrationToken,
    storeCode
});
const {
    loading,
    pageMaskedId,
    findPage,
    pathToFind,
    pageData,
    allPages
} = pbFinderProps;

with findPage(pathname) and use pageData and pageMaskedId to find your page with path_name

and findPage() to getData and check `allPages` to get page with your own condition.

License

MIT © Tapita

1.6.32

6 months ago

1.6.35

6 months ago

1.6.34

6 months ago

1.6.37

5 months ago

1.6.36

6 months ago

2.0.3

10 months ago

1.6.20

11 months ago

1.6.22

10 months ago

1.6.28

9 months ago

1.6.15

12 months ago

1.6.16

12 months ago

1.6.3

1 year ago

1.6.2

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.6.9

1 year ago

1.6.6

1 year ago

1.6.5

1 year ago

1.5.5

2 years ago

1.5.7

1 year ago

1.5.6

1 year ago

1.5.4

2 years ago

1.5.3

2 years ago

1.5.2

2 years ago

1.5.1

2 years ago

2.0.2

2 years ago

2.0.0

2 years ago

1.4.9

2 years ago

1.4.8

2 years ago

1.4.7

2 years ago

1.4.6

2 years ago

1.4.5

2 years ago