@truworth/twc-auth 3.0.5 → 3.0.6
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/build/src/components/LoadingAnimation/index.js +50 -0
- package/build/src/screens/PartnerSSO/PartnerLogin/components/PartnerLoginWebComponent/index.js +3 -12
- package/build/src/screens/SSOLogin/SSOCallback/components/SSOCallbackComponent/index.js +3 -28
- package/build/src/screens/UserConsent/index.js +3 -12
- package/build/types/components/LoadingAnimation/index.d.ts +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { motion } from 'framer-motion';
|
|
4
|
+
const LoadingAnimation = ({ height = 230, width = 250, }) => {
|
|
5
|
+
return (_jsxs("div", { style: {
|
|
6
|
+
height,
|
|
7
|
+
width,
|
|
8
|
+
display: 'flex',
|
|
9
|
+
alignItems: 'center',
|
|
10
|
+
justifyContent: 'center',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
gap: 16,
|
|
13
|
+
}, children: [_jsx(motion.div, { style: {
|
|
14
|
+
display: 'flex',
|
|
15
|
+
gap: 8,
|
|
16
|
+
alignItems: 'center',
|
|
17
|
+
justifyContent: 'center',
|
|
18
|
+
}, children: [0, 1, 2].map((i) => (_jsx(motion.div, { style: {
|
|
19
|
+
width: 12,
|
|
20
|
+
height: 12,
|
|
21
|
+
borderRadius: '50%',
|
|
22
|
+
backgroundColor: '#26C6DA',
|
|
23
|
+
}, animate: {
|
|
24
|
+
y: [0, -16, 0],
|
|
25
|
+
opacity: [0.5, 1, 0.5],
|
|
26
|
+
}, transition: {
|
|
27
|
+
duration: 0.8,
|
|
28
|
+
repeat: Infinity,
|
|
29
|
+
delay: i * 0.15,
|
|
30
|
+
ease: 'easeInOut',
|
|
31
|
+
} }, i))) }), _jsx(motion.div, { style: {
|
|
32
|
+
width: 120,
|
|
33
|
+
height: 4,
|
|
34
|
+
backgroundColor: '#E0E0E0',
|
|
35
|
+
borderRadius: 2,
|
|
36
|
+
overflow: 'hidden',
|
|
37
|
+
}, children: _jsx(motion.div, { style: {
|
|
38
|
+
width: '40%',
|
|
39
|
+
height: '100%',
|
|
40
|
+
backgroundColor: '#26C6DA',
|
|
41
|
+
borderRadius: 2,
|
|
42
|
+
}, animate: {
|
|
43
|
+
x: ['-100%', '250%'],
|
|
44
|
+
}, transition: {
|
|
45
|
+
duration: 1.2,
|
|
46
|
+
repeat: Infinity,
|
|
47
|
+
ease: 'easeInOut',
|
|
48
|
+
} }) })] }));
|
|
49
|
+
};
|
|
50
|
+
export { LoadingAnimation };
|
package/build/src/screens/PartnerSSO/PartnerLogin/components/PartnerLoginWebComponent/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { Flex, Typography } from '@truworth/twc-web-design';
|
|
4
4
|
import { usePartnerLogin } from '../../hooks/internal/usePartnerLogin';
|
|
5
5
|
import { useNavigator } from '../../../../../hooks/useNavigator';
|
|
6
|
-
import
|
|
7
|
-
const Lottie = lazy(() => import('react-lottie'));
|
|
6
|
+
import { LoadingAnimation } from '../../../../../components/LoadingAnimation';
|
|
8
7
|
/**
|
|
9
8
|
* PartnerLoginWebComponent
|
|
10
9
|
*
|
|
@@ -64,14 +63,6 @@ const PartnerLoginWebComponent = ({ partner: partnerProp }) => {
|
|
|
64
63
|
}, 2000);
|
|
65
64
|
}
|
|
66
65
|
}, [error, navigator]);
|
|
67
|
-
return (_jsx(Flex, { justify: 'center', align: 'center', className: 'h-[100vh]', children: _jsxs("div", { className: 'text-center', children: [_jsx(
|
|
68
|
-
//@ts-ignore
|
|
69
|
-
, {
|
|
70
|
-
//@ts-ignore
|
|
71
|
-
options: {
|
|
72
|
-
animationData: redirectAnimation,
|
|
73
|
-
loop: true,
|
|
74
|
-
autoplay: true,
|
|
75
|
-
}, height: 230, width: 250 }) }), error ? (_jsxs(_Fragment, { children: [_jsx(Typography, { size: 'h6', type: 'heading', color: 'error', children: error }), _jsx(Typography, { size: 'small', type: 'body', color: 'gray-400', className: 'mt-2', children: "Redirecting back..." })] })) : (_jsx(_Fragment, { children: _jsx(Typography, { size: 'h6', type: 'heading', color: 'gray-400', children: "Authenticating and Redirecting ..." }) }))] }) }));
|
|
66
|
+
return (_jsx(Flex, { justify: 'center', align: 'center', className: 'h-[100vh]', children: _jsxs("div", { className: 'text-center', children: [_jsx(LoadingAnimation, { height: 230, width: 250 }), error ? (_jsxs(_Fragment, { children: [_jsx(Typography, { size: 'h6', type: 'heading', color: 'error', children: error }), _jsx(Typography, { size: 'small', type: 'body', color: 'gray-400', className: 'mt-2', children: "Redirecting back..." })] })) : (_jsx(_Fragment, { children: _jsx(Typography, { size: 'h6', type: 'heading', color: 'gray-400', children: "Authenticating and Redirecting ..." }) }))] }) }));
|
|
76
67
|
};
|
|
77
68
|
export { PartnerLoginWebComponent };
|
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { Flex, Typography } from '@truworth/twc-web-design';
|
|
4
4
|
import { useSSOCallback } from '../../hooks/internal/useSSOCallback';
|
|
5
5
|
import { useNavigator } from '../../../../../hooks/useNavigator';
|
|
6
|
-
import
|
|
6
|
+
import { LoadingAnimation } from '../../../../../components/LoadingAnimation';
|
|
7
7
|
import { RegistrationMethod } from '../../../../../enums';
|
|
8
|
-
const Lottie = lazy(() => import('react-lottie'));
|
|
9
|
-
class LottieErrorBoundary extends Component {
|
|
10
|
-
constructor(props) {
|
|
11
|
-
super(props);
|
|
12
|
-
this.state = { hasError: false };
|
|
13
|
-
}
|
|
14
|
-
static getDerivedStateFromError() {
|
|
15
|
-
return { hasError: true };
|
|
16
|
-
}
|
|
17
|
-
componentDidCatch() { }
|
|
18
|
-
render() {
|
|
19
|
-
if (this.state.hasError)
|
|
20
|
-
return this.props.fallback;
|
|
21
|
-
return this.props.children;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
8
|
const SSOCallbackComponents = ({ authMethodOverride } = {}) => {
|
|
25
9
|
const navigator = useNavigator();
|
|
26
10
|
const [clientId, setClientId] = useState('');
|
|
@@ -73,15 +57,6 @@ const SSOCallbackComponents = ({ authMethodOverride } = {}) => {
|
|
|
73
57
|
}, 1500);
|
|
74
58
|
}
|
|
75
59
|
}, [error, navigator]);
|
|
76
|
-
|
|
77
|
-
return (_jsx(Flex, { justify: 'center', align: 'center', className: 'h-[100vh]', children: _jsxs("div", { children: [_jsx(LottieErrorBoundary, { fallback: loadingFallback, children: _jsx(Suspense, { fallback: loadingFallback, children: _jsx(Lottie
|
|
78
|
-
//@ts-ignore
|
|
79
|
-
, {
|
|
80
|
-
//@ts-ignore
|
|
81
|
-
options: {
|
|
82
|
-
animationData: redirectAnimation,
|
|
83
|
-
loop: true,
|
|
84
|
-
autoplay: true
|
|
85
|
-
}, height: 230, width: 250 }) }) }), _jsx(Typography, { size: 'h6', type: 'heading', color: 'gray-400', children: "Authenticating and Redirecting ..." })] }) }));
|
|
60
|
+
return (_jsx(Flex, { justify: 'center', align: 'center', className: 'h-[100vh]', children: _jsxs("div", { children: [_jsx(LoadingAnimation, { height: 230, width: 250 }), _jsx(Typography, { size: 'h6', type: 'heading', color: 'gray-400', children: "Authenticating and Redirecting ..." })] }) }));
|
|
86
61
|
};
|
|
87
62
|
export { SSOCallbackComponents };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { Info } from 'lucide-react';
|
|
5
5
|
import { Flex, Typography, ResponsiveModal as Modal, Button, ResponsiveModal } from '@truworth/twc-web-design';
|
|
@@ -7,10 +7,9 @@ import { useAuthPackageContext } from '../../hooks/internal/useAuthPackageContex
|
|
|
7
7
|
import { CDN_IMAGES_URL } from '../../constants/cdn-url';
|
|
8
8
|
import { useConsent } from './hooks/internal/useConsent';
|
|
9
9
|
import { ScreenLayout } from "../../components/ScreenLayout";
|
|
10
|
+
import { LoadingAnimation } from '../../components/LoadingAnimation';
|
|
10
11
|
import VerifyMobile from "../VerifyMobile";
|
|
11
12
|
import VerifyEmail from "../VerifyEmail";
|
|
12
|
-
import redirectHome from '../../../assets/animation/redirect-home.json';
|
|
13
|
-
const Lottie = lazy(() => import('react-lottie'));
|
|
14
13
|
const UserConsent = ({ userDetails, handleBack }) => {
|
|
15
14
|
const { email, phone } = userDetails || {};
|
|
16
15
|
const [redirectModal, setRedirectModal] = useState(false);
|
|
@@ -74,15 +73,7 @@ const RedirectToHomeModal = ({ redirectModal }) => {
|
|
|
74
73
|
}, 2000);
|
|
75
74
|
return () => clearTimeout(timer);
|
|
76
75
|
}, []);
|
|
77
|
-
return (_jsxs(Modal, { title: "", open: redirectModal, showCloseButton: false, footer: null, children: [isMounted && (_jsx(
|
|
78
|
-
/* @ts-ignore */
|
|
79
|
-
, {
|
|
80
|
-
/* @ts-ignore */
|
|
81
|
-
options: {
|
|
82
|
-
animationData: redirectHome,
|
|
83
|
-
loop: true,
|
|
84
|
-
autoplay: true
|
|
85
|
-
}, height: 150, width: 250 }) })), _jsxs(Flex, { direction: 'column', style: { marginTop: isMounted ? "-30px" : "0" }, children: [_jsx(Typography, { type: 'heading', size: 'h5', className: 'text-center mb-6', color: "text-gray-800", children: "Redirecting to the website homepage" }), _jsxs(Flex, { children: [_jsx(Info, { color: 'blue' }), _jsx(Typography, { type: 'body', size: 'small', className: 'text-center mb-6', color: "text-gray-800", children: "We have not stored any information you shared during registration." })] })] })] }));
|
|
76
|
+
return (_jsxs(Modal, { title: "", open: redirectModal, showCloseButton: false, footer: null, children: [isMounted && (_jsx(LoadingAnimation, { height: 150, width: 250 })), _jsxs(Flex, { direction: 'column', style: { marginTop: isMounted ? "-30px" : "0" }, children: [_jsx(Typography, { type: 'heading', size: 'h5', className: 'text-center mb-6', color: "text-gray-800", children: "Redirecting to the website homepage" }), _jsxs(Flex, { children: [_jsx(Info, { color: 'blue' }), _jsx(Typography, { type: 'body', size: 'small', className: 'text-center mb-6', color: "text-gray-800", children: "We have not stored any information you shared during registration." })] })] })] }));
|
|
86
77
|
};
|
|
87
78
|
const VerifyMobileModal = ({ visible, hide, sessionToken, phone }) => {
|
|
88
79
|
return (_jsx(ResponsiveModal, { title: 'Verify Mobile', open: visible, onClose: hide, onOpenChange: hide, maskClosable: false, showCloseButton: false, children: _jsx(VerifyMobile, { sessionToken: sessionToken, phone: phone }) }));
|