0.0.20 • Published 1 year ago

@ourpay/donation v0.0.20

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

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 dev

Usage

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

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago