@mainmoneyapp/js-react 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -3
- package/package.json +2 -2
- package/src/index.d.ts +3 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import { createElement, useEffect, useRef } from "react";
|
|
3
3
|
import { mountCheckout } from "@mainmoneyapp/js-checkout";
|
|
4
|
-
function CheckoutWizard({ checkout, logoUrl }) {
|
|
4
|
+
function CheckoutWizard({ checkout, logoUrl, colorScheme, variant }) {
|
|
5
5
|
const ref = useRef(null);
|
|
6
6
|
useEffect(() => {
|
|
7
7
|
if (ref.current === null) {
|
|
8
8
|
return;
|
|
9
9
|
}
|
|
10
|
-
return mountCheckout(ref.current, checkout, { logoUrl });
|
|
11
|
-
}, [checkout, logoUrl]);
|
|
10
|
+
return mountCheckout(ref.current, checkout, { logoUrl, variant });
|
|
11
|
+
}, [checkout, logoUrl, variant]);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (colorScheme !== void 0) {
|
|
14
|
+
checkout.setColorScheme(colorScheme);
|
|
15
|
+
}
|
|
16
|
+
}, [checkout, colorScheme]);
|
|
12
17
|
return createElement("div", { ref });
|
|
13
18
|
}
|
|
14
19
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mainmoneyapp/js-react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "React checkout wizard for the MainMoney JS/TS frontend SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
"react": ">=18"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@mainmoneyapp/js-checkout": "0.
|
|
47
|
+
"@mainmoneyapp/js-checkout": "0.2.0"
|
|
48
48
|
}
|
|
49
49
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { Checkout } from "@mainmoneyapp/js-checkout";
|
|
1
|
+
import type { Checkout, CheckoutVariant, ColorScheme } from "@mainmoneyapp/js-checkout";
|
|
2
2
|
|
|
3
3
|
export type CheckoutWizardProps = {
|
|
4
4
|
checkout: Checkout;
|
|
5
5
|
logoUrl?: string;
|
|
6
|
+
colorScheme?: ColorScheme;
|
|
7
|
+
variant?: CheckoutVariant;
|
|
6
8
|
};
|
|
7
9
|
|
|
8
10
|
export declare function CheckoutWizard(props: CheckoutWizardProps): unknown;
|