@rpg-engine/long-bow 0.8.177 → 0.8.179
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/Stepper.d.ts +1 -0
- package/dist/components/Store/PaymentMethodModal.d.ts +2 -0
- package/dist/components/Tutorial/TutorialStepper.d.ts +2 -1
- package/dist/long-bow.cjs.development.js +20 -4
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +20 -4
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Stepper.tsx +3 -0
- package/src/components/Store/PaymentMethodModal.tsx +21 -2
- package/src/components/Tutorial/TutorialStepper.tsx +3 -1
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@ interface IStepperProps {
|
|
|
18
18
|
onClick: (() => void) | (() => Promise<void>) | ((e: any) => Promise<void>);
|
|
19
19
|
};
|
|
20
20
|
onError?: (message: string) => void;
|
|
21
|
+
onStepChange?: (stepIndex: number) => void;
|
|
21
22
|
useSideArrows?: boolean; // New prop to control arrow position
|
|
22
23
|
styles?: {
|
|
23
24
|
stepperProgressColor?: string;
|
|
@@ -28,6 +29,7 @@ export const Stepper: React.FC<IStepperProps> = ({
|
|
|
28
29
|
steps,
|
|
29
30
|
finalCTAButton,
|
|
30
31
|
onError,
|
|
32
|
+
onStepChange: onStepChangeProp,
|
|
31
33
|
useSideArrows = false, // Default to false for backwards compatibility
|
|
32
34
|
styles,
|
|
33
35
|
}) => {
|
|
@@ -60,6 +62,7 @@ export const Stepper: React.FC<IStepperProps> = ({
|
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
setCurrentStep(step);
|
|
65
|
+
onStepChangeProp?.(step);
|
|
63
66
|
};
|
|
64
67
|
|
|
65
68
|
const renderArrows = () => {
|
|
@@ -9,17 +9,21 @@ export interface IPaymentMethodModalProps {
|
|
|
9
9
|
dcRequired?: number;
|
|
10
10
|
onPayWithDC: () => void;
|
|
11
11
|
onPayWithCard: () => void;
|
|
12
|
+
onPayWithPix: () => void;
|
|
12
13
|
onClose: () => void;
|
|
14
|
+
showPix?: boolean;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
type PaymentMethod = 'dc' | 'card';
|
|
17
|
+
type PaymentMethod = 'dc' | 'card' | 'pix';
|
|
16
18
|
|
|
17
19
|
export const PaymentMethodModal: React.FC<IPaymentMethodModalProps> = ({
|
|
18
20
|
dcBalance,
|
|
19
21
|
dcRequired,
|
|
20
22
|
onPayWithDC,
|
|
21
23
|
onPayWithCard,
|
|
24
|
+
onPayWithPix,
|
|
22
25
|
onClose,
|
|
26
|
+
showPix = false,
|
|
23
27
|
}) => {
|
|
24
28
|
const [selected, setSelected] = useState<PaymentMethod>('card');
|
|
25
29
|
|
|
@@ -41,10 +45,12 @@ export const PaymentMethodModal: React.FC<IPaymentMethodModalProps> = ({
|
|
|
41
45
|
const handleConfirm = useCallback(() => {
|
|
42
46
|
if (selected === 'dc' && !dcDisabled) {
|
|
43
47
|
onPayWithDC();
|
|
48
|
+
} else if (selected === 'pix') {
|
|
49
|
+
onPayWithPix();
|
|
44
50
|
} else {
|
|
45
51
|
onPayWithCard();
|
|
46
52
|
}
|
|
47
|
-
}, [selected, dcDisabled, onPayWithDC, onPayWithCard]);
|
|
53
|
+
}, [selected, dcDisabled, onPayWithDC, onPayWithCard, onPayWithPix]);
|
|
48
54
|
|
|
49
55
|
const dcSubText =
|
|
50
56
|
dcRequired !== undefined
|
|
@@ -79,6 +85,19 @@ export const PaymentMethodModal: React.FC<IPaymentMethodModalProps> = ({
|
|
|
79
85
|
</OptionText>
|
|
80
86
|
</RadioOption>
|
|
81
87
|
|
|
88
|
+
{showPix && (
|
|
89
|
+
<RadioOption
|
|
90
|
+
$selected={selected === 'pix'}
|
|
91
|
+
onPointerDown={() => setSelected('pix')}
|
|
92
|
+
>
|
|
93
|
+
<RadioCircle $selected={selected === 'pix'} />
|
|
94
|
+
<OptionText>
|
|
95
|
+
<OptionLabel>Pix</OptionLabel>
|
|
96
|
+
<OptionSub>Instant payment via Pix</OptionSub>
|
|
97
|
+
</OptionText>
|
|
98
|
+
</RadioOption>
|
|
99
|
+
)}
|
|
100
|
+
|
|
82
101
|
<RadioOption
|
|
83
102
|
$selected={selected === 'dc'}
|
|
84
103
|
$disabled={dcDisabled}
|
|
@@ -16,11 +16,12 @@ export interface ITutorialLesson {
|
|
|
16
16
|
export interface ITutorialStepperProps {
|
|
17
17
|
lessons: ITutorialLesson[];
|
|
18
18
|
onLessonFinish: () => void;
|
|
19
|
+
onStepChange?: (stepIndex: number) => void;
|
|
19
20
|
imageStyle?: CSSProperties;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export const TutorialStepper = React.memo(
|
|
23
|
-
({ lessons, onLessonFinish, imageStyle }: ITutorialStepperProps) => {
|
|
24
|
+
({ lessons, onLessonFinish, onStepChange, imageStyle }: ITutorialStepperProps) => {
|
|
24
25
|
const generateLessons = useMemo(
|
|
25
26
|
() =>
|
|
26
27
|
lessons.map((lesson, index) => ({
|
|
@@ -74,6 +75,7 @@ export const TutorialStepper = React.memo(
|
|
|
74
75
|
label: 'Close',
|
|
75
76
|
onClick: onLessonFinish,
|
|
76
77
|
}}
|
|
78
|
+
onStepChange={onStepChange}
|
|
77
79
|
useSideArrows
|
|
78
80
|
/>
|
|
79
81
|
</Container>
|