@redneckz/wildless-cms-uni-blocks 0.14.676 → 0.14.677
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/bundle/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/bundle/bundle.umd.js +23 -12
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/hooks/useNavigator.d.ts +8 -0
- package/bundle/index.d.ts +1 -0
- package/dist/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/dist/api/RetailAPI/updateRefreshToken.js +6 -10
- package/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/dist/components/CreditCardForm/CreditCardForm.js +4 -1
- package/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/dist/components/CreditForm/CreditForm.js +4 -1
- package/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/dist/hooks/useNavigator.d.ts +8 -0
- package/dist/hooks/useNavigator.js +13 -0
- package/dist/hooks/useNavigator.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/lib/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/lib/api/RetailAPI/updateRefreshToken.js +6 -10
- package/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/lib/components/CreditCardForm/CreditCardForm.js +4 -1
- package/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/lib/components/CreditForm/CreditForm.js +4 -1
- package/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/lib/hooks/useNavigator.d.ts +8 -0
- package/lib/hooks/useNavigator.js +10 -0
- package/lib/hooks/useNavigator.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/mobile/bundle/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/bundle/bundle.umd.js +23 -12
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/hooks/useNavigator.d.ts +8 -0
- package/mobile/bundle/index.d.ts +1 -0
- package/mobile/dist/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/dist/api/RetailAPI/updateRefreshToken.js +6 -10
- package/mobile/dist/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js +4 -1
- package/mobile/dist/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/dist/components/CreditForm/CreditForm.js +4 -1
- package/mobile/dist/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/dist/hooks/useNavigator.d.ts +8 -0
- package/mobile/dist/hooks/useNavigator.js +13 -0
- package/mobile/dist/hooks/useNavigator.js.map +1 -0
- package/mobile/dist/index.d.ts +1 -0
- package/mobile/dist/index.js +3 -1
- package/mobile/dist/index.js.map +1 -1
- package/mobile/lib/api/RetailAPI/updateRefreshToken.d.ts +1 -1
- package/mobile/lib/api/RetailAPI/updateRefreshToken.js +6 -10
- package/mobile/lib/api/RetailAPI/updateRefreshToken.js.map +1 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js +4 -1
- package/mobile/lib/components/CreditCardForm/CreditCardForm.js.map +1 -1
- package/mobile/lib/components/CreditForm/CreditForm.js +4 -1
- package/mobile/lib/components/CreditForm/CreditForm.js.map +1 -1
- package/mobile/lib/hooks/useNavigator.d.ts +8 -0
- package/mobile/lib/hooks/useNavigator.js +10 -0
- package/mobile/lib/hooks/useNavigator.js.map +1 -0
- package/mobile/lib/index.d.ts +1 -0
- package/mobile/lib/index.js +1 -0
- package/mobile/lib/index.js.map +1 -1
- package/mobile/src/api/RetailAPI/updateRefreshToken.ts +6 -12
- package/mobile/src/components/CreditCardForm/CreditCardForm.tsx +6 -1
- package/mobile/src/components/CreditForm/CreditForm.tsx +6 -1
- package/mobile/src/hooks/useNavigator.ts +15 -0
- package/mobile/src/index.ts +1 -0
- package/package.json +1 -1
- package/src/api/RetailAPI/updateRefreshToken.ts +6 -12
- package/src/components/CreditCardForm/CreditCardForm.tsx +6 -1
- package/src/components/CreditForm/CreditForm.tsx +6 -1
- package/src/hooks/useNavigator.ts +15 -0
- package/src/index.ts +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { JSX } from '@redneckz/uni-jsx';
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from '@redneckz/uni-jsx/lib/hooks';
|
|
3
3
|
import { updateRefreshToken } from '../../api/RetailAPI/updateRefreshToken';
|
|
4
|
+
import { useNavigator } from '../../hooks/useNavigator';
|
|
4
5
|
import { BlockWrapper } from '../../ui-kit/BlockWrapper';
|
|
5
6
|
import { type UniBlockProps } from '../../UniBlock/UniBlockProps';
|
|
6
7
|
import { style } from '../../utils/style';
|
|
@@ -12,6 +13,8 @@ import { stepsSectionsMap } from './creditFormStepsData';
|
|
|
12
13
|
|
|
13
14
|
interface CreditFormWizardProps extends CreditFormContent, UniBlockProps {}
|
|
14
15
|
|
|
16
|
+
const PORTAL_NATURAL_URL = '/';
|
|
17
|
+
|
|
15
18
|
const WIZARD_STEPS = 5;
|
|
16
19
|
|
|
17
20
|
const WIZARD_TITLES = [
|
|
@@ -32,7 +35,9 @@ export const CreditForm = JSX<CreditFormWizardProps>(({ className, ...rest }) =>
|
|
|
32
35
|
[formContainerRef],
|
|
33
36
|
);
|
|
34
37
|
|
|
35
|
-
|
|
38
|
+
const navigator = useNavigator();
|
|
39
|
+
|
|
40
|
+
useEffect(() => updateRefreshToken(() => navigator.assign(PORTAL_NATURAL_URL)), []);
|
|
36
41
|
|
|
37
42
|
const handleNextStep = useCallback(() => {
|
|
38
43
|
setStep((_) => Math.min(_ + 1, WIZARD_STEPS));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface Navigator {
|
|
2
|
+
assign: (url: string) => void;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function useNavigator(): Navigator {
|
|
6
|
+
return useNavigator._impl();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
useNavigator._impl = (): Navigator => ({
|
|
10
|
+
assign: (url) => globalThis.location.assign(url),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
useNavigator.setup = (impl: () => Navigator) => {
|
|
14
|
+
useNavigator._impl = impl;
|
|
15
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { setup } from '@redneckz/uni-jsx/lib/setup';
|
|
|
3
3
|
export { Blocks } from './components/Blocks';
|
|
4
4
|
export { ContentPage } from './components/ContentPage/ContentPage';
|
|
5
5
|
export { handlerDecorator } from './hooks/handlerDecorator';
|
|
6
|
+
export { useNavigator } from './hooks/useNavigator';
|
|
6
7
|
export { useRouter } from './hooks/useRouter';
|
|
7
8
|
export { projectSettings } from './ProjectSettings';
|
|
8
9
|
export { joinList } from './utils/joinList';
|