1.4.4 • Published 2 years ago

simi-pagebuilder-react v1.4.4

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

simi-pagebuilder-react

SimiCart React PageBuilder Client

NPM JavaScript Style Guide

Install

npm install --save simi-pagebuilder-react

Usage

import React, { Component } from 'react'

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

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

Develop

git clone https://github.com/Simicart/simi-pagebuilder-react
cd simi-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 © SimiCart

1.4.4

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.7

2 years ago

1.3.6

2 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.21

3 years ago

1.2.20

3 years ago

1.2.18

3 years ago

1.2.19

3 years ago

1.2.16

3 years ago

1.2.17

3 years ago

1.2.14

3 years ago

1.2.15

3 years ago

1.2.12

3 years ago

1.2.13

3 years ago

1.2.11

3 years ago

1.2.9

3 years ago

1.2.10

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.3-beta

3 years ago

1.0.4-beta

3 years ago

1.0.2-beta

3 years ago

1.0.1

3 years ago