0.0.20 • Published 3 years ago
@ourpay/donation v0.0.20
ourpayelements
JS/React library for MFE Demo widgets
Development
- Clone repository
- Install dependencies
cd mfe-demo-widget
npm install- Start development bundler
npm run dev- Start example web app
cd example/react OR cd example/js
npm i
npm run devUsage
Install as an NPM package (npm i @ourpay/donation) or import from CDN: https://www.unpkg.com/@ourpay/donation
NOTE: If you want to inject the bundle straight into the browser via script tags, make sure to import the browser bundle: https://www.unpkg.com/@ourpay/donation/dist/browser.js as it has all the React dependencies included
React
import {
DonationForm,
DonationTable,
DonationProvider,
} from "@ourpay/donation";
export default function App() {
return (
<DonationProvider
appId={123}
backgroundColor="#758BFD"
primaryTextColor="#F1F2F6"
>
<DonationForm defaultAmount={5} />
<DonationTable title="Donation Table" />
</DonationProvider>
);
}JS
Example:
// Initialize JS factory
const elements = OurpayDonation.Elements({
appId: 123,
backgroundColor: "#fff",
primaryTextColor: "#000",
}); // uses OurpayDonation global variable
elements.DonationForm.mount("#form-id", {
defaultAmount: 100,
});
elements.DonationTable.mount("#table-id", {
title: "Donation Table",
});0.0.20
3 years ago
0.0.16
3 years ago
0.0.17
3 years ago
0.0.18
3 years ago
0.0.19
3 years ago
0.0.15
3 years ago
0.0.14
3 years ago
0.0.13
3 years ago
0.0.12
3 years ago
0.0.11
3 years ago
0.0.10
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago