0.3.3 • Published 1 year ago

labcode-layer-test v0.3.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

LabcodeLayer Library Test

How to use LabcodeLayer

Install


$ npm install labcode-layer-test

JavaScript


import { LabcodeLayerInit, LabcodeLayer, RemoveLabcodeLayer } from "labcode-layer-test";

// When initiate LabcodeLayer
// This function should be executed in the first page or root component.
LabcodeLayerInit();

// When change props of LabcodeLayer
LabcodeLayer({opacity: 20, bgUrl: "(Labcode Layer Image Url)", redirectURI: "https://www.google.com"});

// When remove LabcodeLayer
RemoveLabcodeLayer();

React


import React, { useEffect } from "react";
import { useLocation } from "react-router-dom";
import { LabcodeLayerInit, LabcodeLayer, RemoveLabcodeLayer } from "labcode-layer-test";

const Component = () => {
  const { pathname } = useLocation();

  useEffect(() => {
    // When initiate LabcodeLayer
    // This function should be executed in the first page or root component.
    LabcodeLayerInit();

    if (pathname === '/layer-applied-page') {
      // When change props of LabcodeLayer
      LabcodeLayer({opacity: 5, id: 1, redirectURI: "back"});
    } else {
      // When remove LabcodeLayer
      RemoveLabcodeLayer();
    }
  }, [pathname]);

  return (
    ...
  )
}

Props

propsvaluetyperemark
opacity20numberoptional (default: 5)
bgUrl"https://labcode-bg-url.jpg"stringoptional
id1numberoptional (You can request Labcode Layer image by id. This method requires network to be available.)
devToolsUsetruebooleanoptional (default: true)
redirectURIURI (i.e. "https://www.google.com") or "back" => history.back()stringoptional (default: "back")

If you don't provide either bgUrl or id, it will return error.

Dependency


  • devtools-detect
  • typescript
0.3.0

1 year ago

0.2.9

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.3

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago