@stigg/react-sdk 5.28.3 → 5.28.4
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/components/checkout/CheckoutProvider.d.ts +1 -0
- package/dist/components/checkout/hooks/useLoadCheckout.d.ts +1 -0
- package/dist/components/checkout/summary/CheckoutSummary.d.ts +2 -1
- package/dist/components/checkout/summary/CheckoutSummarySkeleton.d.ts +3 -1
- package/dist/react-sdk.cjs.development.js +25 -16
- package/dist/react-sdk.cjs.development.js.map +1 -1
- package/dist/react-sdk.cjs.production.min.js +1 -1
- package/dist/react-sdk.cjs.production.min.js.map +1 -1
- package/dist/react-sdk.esm.js +25 -16
- package/dist/react-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/checkout/CheckoutContainer.tsx +3 -2
- package/src/components/checkout/CheckoutProvider.tsx +8 -1
- package/src/components/checkout/hooks/useLoadCheckout.ts +1 -0
- package/src/components/checkout/summary/CheckoutSummary.tsx +3 -2
- package/src/components/checkout/summary/CheckoutSummarySkeleton.tsx +2 -2
package/package.json
CHANGED
|
@@ -83,7 +83,7 @@ export function CheckoutContainer({
|
|
|
83
83
|
onMockCheckoutPreview,
|
|
84
84
|
}: CheckoutContainerProps) {
|
|
85
85
|
const { stripePromise, setupIntentClientSecret } = useStripeIntegration();
|
|
86
|
-
const [{ stiggTheme, widgetState, theme }] = useCheckoutContext();
|
|
86
|
+
const [{ stiggTheme, widgetState, theme, isWidgetWatermarkEnabled }] = useCheckoutContext();
|
|
87
87
|
const { currentStep } = useProgressBarModel();
|
|
88
88
|
|
|
89
89
|
const { isLoadingCheckoutData } = widgetState;
|
|
@@ -151,7 +151,7 @@ export function CheckoutContainer({
|
|
|
151
151
|
<CheckoutContent>
|
|
152
152
|
<CheckoutPanel>{isLoadingCheckoutData ? <ContentLoadingSkeleton /> : checkoutContent}</CheckoutPanel>
|
|
153
153
|
{isLoadingCheckoutData ? (
|
|
154
|
-
<CheckoutSummarySkeleton />
|
|
154
|
+
<CheckoutSummarySkeleton isWidgetWatermarkEnabled={isWidgetWatermarkEnabled} />
|
|
155
155
|
) : (
|
|
156
156
|
<CheckoutSummary
|
|
157
157
|
disablePromotionCode={disablePromotionCode}
|
|
@@ -160,6 +160,7 @@ export function CheckoutContainer({
|
|
|
160
160
|
onCheckoutCompleted={onCheckoutCompleted}
|
|
161
161
|
isFreeDowngrade={isFreeDowngrade}
|
|
162
162
|
onMockCheckoutPreview={onMockCheckoutPreview}
|
|
163
|
+
isWidgetWatermarkEnabled={isWidgetWatermarkEnabled}
|
|
163
164
|
/>
|
|
164
165
|
)}
|
|
165
166
|
</CheckoutContent>
|
|
@@ -35,6 +35,7 @@ export interface CheckoutContextState {
|
|
|
35
35
|
addonsStep: AddonsStepState;
|
|
36
36
|
paymentStep: PaymentStepState;
|
|
37
37
|
widgetState: WidgetState;
|
|
38
|
+
isWidgetWatermarkEnabled: boolean;
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
export const CheckoutContext = React.createContext<
|
|
@@ -101,7 +102,12 @@ export function CheckoutProvider({
|
|
|
101
102
|
}: {
|
|
102
103
|
children: React.ReactNode;
|
|
103
104
|
} & CheckoutProviderProps) {
|
|
104
|
-
const { checkout, isLoading } = useLoadCheckout({
|
|
105
|
+
const { checkout, isLoading, isWidgetWatermarkEnabled } = useLoadCheckout({
|
|
106
|
+
resourceId,
|
|
107
|
+
planId,
|
|
108
|
+
billingCountryCode,
|
|
109
|
+
onMockCheckoutState,
|
|
110
|
+
});
|
|
105
111
|
const configuration: CustomizedTheme = checkout?.configuration
|
|
106
112
|
? mapCheckoutConfiguration(checkout.configuration)
|
|
107
113
|
: { typography: mapTypography(defaultCheckoutTypography) };
|
|
@@ -147,6 +153,7 @@ export function CheckoutProvider({
|
|
|
147
153
|
paymentStep,
|
|
148
154
|
resourceId: checkout?.resource?.id,
|
|
149
155
|
widgetState: { readOnly: false, isValid: true, isLoadingCheckoutData: isLoading },
|
|
156
|
+
isWidgetWatermarkEnabled,
|
|
150
157
|
};
|
|
151
158
|
|
|
152
159
|
return initialState;
|
|
@@ -110,7 +110,8 @@ export const CheckoutSummary = ({
|
|
|
110
110
|
disableSuccessAnimation,
|
|
111
111
|
isFreeDowngrade,
|
|
112
112
|
onMockCheckoutPreview,
|
|
113
|
-
|
|
113
|
+
isWidgetWatermarkEnabled,
|
|
114
|
+
}: CheckoutContainerProps & { isFreeDowngrade: boolean; isWidgetWatermarkEnabled: boolean }) => {
|
|
114
115
|
const [isCheckoutCompletedSuccessfully, setIsCheckoutCompletedSuccessfully] = useState(false);
|
|
115
116
|
const { setErrorMessage } = usePaymentStepModel();
|
|
116
117
|
const progressBar = useProgressBarModel();
|
|
@@ -415,7 +416,7 @@ export const CheckoutSummary = ({
|
|
|
415
416
|
</SummaryCard>
|
|
416
417
|
<PoweredByStigg
|
|
417
418
|
source="checkout"
|
|
418
|
-
showWatermark
|
|
419
|
+
showWatermark={isWidgetWatermarkEnabled}
|
|
419
420
|
style={{ marginTop: 8, display: 'flex', justifyContent: 'center' }}
|
|
420
421
|
/>
|
|
421
422
|
{!disableSuccessAnimation && isCheckoutCompletedSuccessfully && (
|
|
@@ -3,7 +3,7 @@ import { PoweredByStigg } from '../../common/PoweredByStigg';
|
|
|
3
3
|
import { SummaryCard, SummaryContainer } from './CheckoutSummary';
|
|
4
4
|
import { FlexedSkeleton, Skeleton, SkeletonsContainer } from '../components/Skeletons.style';
|
|
5
5
|
|
|
6
|
-
export const CheckoutSummarySkeleton = () => {
|
|
6
|
+
export const CheckoutSummarySkeleton = ({ isWidgetWatermarkEnabled }: { isWidgetWatermarkEnabled: boolean }) => {
|
|
7
7
|
return (
|
|
8
8
|
<SummaryContainer>
|
|
9
9
|
<SummaryCard>
|
|
@@ -31,7 +31,7 @@ export const CheckoutSummarySkeleton = () => {
|
|
|
31
31
|
</SummaryCard>
|
|
32
32
|
<PoweredByStigg
|
|
33
33
|
source="checkout"
|
|
34
|
-
showWatermark
|
|
34
|
+
showWatermark={isWidgetWatermarkEnabled}
|
|
35
35
|
style={{ marginTop: 8, display: 'flex', justifyContent: 'center' }}
|
|
36
36
|
/>
|
|
37
37
|
</SummaryContainer>
|