Skip to content

Latest commit

 

History

History
172 lines (150 loc) · 2.98 KB

README.md

File metadata and controls

172 lines (150 loc) · 2.98 KB

Share

The Share Component will help you to share Name, Title and a link in your mobile apps like Gmail, Whatsapp, Twitter, FB etc.

Demo

A minimal Demo Link

Usage/Examples

Value Used as a Description
Share ✅ Component Can be used as Component
share ✅ Service Can be used as Service
1. Here's an example of basic usage with Multiple Import: with Default Import:
// Default import will return Share Component
import Share from 'fe-pilot/Share';

<Share /> // Used as a Component
2. Here's an example of basic usage with Multiple Import: with Multiple Import:
import { Share, share } from 'fe-pilot/Share';

<Share /> // Used as a Component

share(); // Used as a Service
3. Here's an example of a advanced usage:
import { Share } from 'fe-pilot/Share';

const successCb = (response) => {
  console.log("success response:", response);
}

const failureCb = (response) => {
  console.log("failure response:", response);
}

return (
  <Share successCb={successCb} failureCb={failureCb}>
    Pass clickable element (button, anchor etc)  here to bind onClick event
  </Share>
);

Props

Props Type Description Response
successCb Function It will be called on success
{
    data: "Can be array/object/string/number",
    msgType: "SUCCESSFUL",
    msg: "A success msg",
    status: "SUCCESS"
}
      
loadingCb Function It will be called before success/failure.
{
  msgType: "LOADING",
  msg: "LOADING...",
  status: "LOADING"
}
failureCb Function It will be called on failure
{
  msgType: "ERROR",
  msg: "A failed msg",
  status: "FAILURE"
}
       
Props Type Description Default Values
showForever Boolean To hide/remove unsupported feature, make it false. Default value is true.
title String Provide a title
---
description String Provide a Description
---
url String Provide a Link
---