0.3.3 • Published 2 years ago

labcode-layer-test v0.3.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years 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

2 years ago

0.2.9

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.3

2 years ago

0.2.8

2 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago