plurality-repconnect-widget
v1.6.0
Published
A React component for social connect popup.
Maintainers
Readme
Plurality Reputation Connect Widget
This repo contains the functionality to load the plurality identity oracle as a popup widget.
To run
npm install && npm run startTo use it in a react project
Here is a basic demo how it can be used in any react project
import PluralityPopupWidget from 'plurality-repconnect-widget';
const App = () => {
// Handle the data returned from the widget
const handleDataReturned = (data) => {
console.log('Received data from widget:', data);
// Handle the received data in the external webpage
// ... (perform actions with the received data)
// Call connectWallet to ensure the user is connected to the dapp
connectWallet();
};
return (
<div>
<PluralityPopupWidget
options={{ apps: 'facebook,twitter' }}
onDataReturned={handleDataReturned}
// all customization params are optional
// customization={{ height: '200px', width: '500px', initialBackgroundColor: '#E8A123', initialTextColor: '#FFFFFF', flipBackgroundColor: '#12AE83', flipTextColor: '#FFFFFF'}}
/>
</div>
);
};To publish new version on npm registry
- Update the version in
package.jsonfile - Run
npm run webpackand verify the./lib/PluralityPopupWidget.jsfile if it is updated - Run
npm versionand verify if the version is updated correctly locally - Run
npm publishto publish it to public npm registry
Customizable attributes
height: Specify the height of the buttonwidth: Specify the width of the buttoninitialBackgroundColor: Specify the intial background color of the buttoninitialTextColor: Specify the intial text color of the buttonflipBackgroundColor: Specify the flipped background color of the buttonflipTextColor: Specify the flipped text color of the button
Release
- The package is released on NPM registry via a build pipeline on merge to main
