1.0.1 • Published 11 months ago

@ilesh_98/intercept-demo v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

intercept-demo

This package provides a simple example to add a custom component to the venia-ui footer.

Installation

To install this extension, add it as a devDependency to your app project:

yarn add -D @ilesh_98/intercept-demo



## Configurations

Once the extension is installed, update your `local-intercept.js` file located in the root of your project or in the `venia-concept` package with the following code:

```javascript
const { Targetables } = require("@magento/pwa-buildpack");

function localIntercept(targets) {
  const targetables = Targetables.using(targets);

  const Footer = targetables.reactComponent(
    "@magento/venia-ui/lib/components/Footer/footer.js"
  );

  const CustomComponent = Footer.addImport(
    "{ CustomComponent } from '../../../../extensions/intercept-demo'"
  );

  Footer.insertBeforeJSX(
    "<Link to={resourceUrl('/')} aria-label={title} className={classes.logoContainer} />",
    `<${CustomComponent} />`
  );
}

module.exports = localIntercept;
1.0.1

11 months ago

1.0.0

11 months ago