@stigg/react-sdk 4.4.0-beta.2 → 4.4.0-beta.3

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.
@@ -17,6 +17,7 @@ export declare function getProgressBarInitialState({ availableAddons }: {
17
17
  availableAddons?: Addon[];
18
18
  }): ProgressBarState;
19
19
  export declare function useProgressBarModel(): {
20
+ currentStep: CheckoutStep;
20
21
  progressBarState: ProgressBarState;
21
22
  isLastStep: boolean;
22
23
  isCheckoutComplete: boolean;
@@ -6665,7 +6665,9 @@ function useGoNext() {
6665
6665
 
6666
6666
  function useProgressBarModel() {
6667
6667
  var progressBarState = useProgressBarState();
6668
+ var currentStep = progressBarState.steps[progressBarState.activeStep];
6668
6669
  return {
6670
+ currentStep: currentStep,
6669
6671
  progressBarState: progressBarState,
6670
6672
  isLastStep: progressBarState.activeStep === progressBarState.steps.length - 1,
6671
6673
  isCheckoutComplete: isCheckoutComplete(progressBarState),
@@ -12518,20 +12520,20 @@ var CheckoutPlanStep = function CheckoutPlanStep() {
12518
12520
  }));
12519
12521
  };
12520
12522
 
12521
- var getStepProps = function getStepProps(step) {
12522
- switch (step) {
12523
- case 0:
12523
+ var getStepProps = function getStepProps(currentStep) {
12524
+ switch (currentStep.key) {
12525
+ case CheckoutStepKey.PLAN:
12524
12526
  return {
12525
12527
  allowChangePlan: true,
12526
12528
  content: React__default.createElement(CheckoutPlanStep, null)
12527
12529
  };
12528
12530
 
12529
- case 1:
12531
+ case CheckoutStepKey.ADDONS:
12530
12532
  return {
12531
12533
  content: React__default.createElement(CheckoutAddonsStep, null)
12532
12534
  };
12533
12535
 
12534
- case 2:
12536
+ case CheckoutStepKey.PAYMENT:
12535
12537
  return {
12536
12538
  content: React__default.createElement(PaymentStep, null)
12537
12539
  };
@@ -12558,15 +12560,14 @@ function CheckoutContainer(_ref) {
12558
12560
  widgetState = _useCheckoutContext$.widgetState;
12559
12561
 
12560
12562
  var _useProgressBarModel = useProgressBarModel(),
12561
- progressBarState = _useProgressBarModel.progressBarState;
12563
+ currentStep = _useProgressBarModel.currentStep;
12562
12564
 
12563
- var activeStep = progressBarState.activeStep;
12564
12565
  var isLoadingCheckoutData = widgetState.isLoadingCheckoutData; // uncomment for fun!
12565
12566
  // if (activeStep > 2) {
12566
12567
  // return <SurpriseStep />;
12567
12568
  // }
12568
12569
 
12569
- var _getStepProps = getStepProps(activeStep),
12570
+ var _getStepProps = getStepProps(currentStep),
12570
12571
  content = _getStepProps.content,
12571
12572
  allowChangePlan = _getStepProps.allowChangePlan;
12572
12573