The Share
Component will help you to share
Name
, Title
and a link
in your mobile apps like Gmail
, Whatsapp
, Twitter
, FB
etc.
A minimal Demo Link
Value | Used as a | Description |
---|---|---|
Share | ✅ Component | Can be used as Component |
share | ✅ Service | Can be used as Service |
// Default import will return Share Component
import Share from 'fe-pilot/Share';
<Share /> // Used as a Component
import { Share, share } from 'fe-pilot/Share';
<Share /> // Used as a Component
share(); // Used as a Service
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 | 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 | --- |