@solidstarters/solid-core-ui 1.1.2 → 1.1.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/auth/SolidChangeForcePassword.d.ts +3 -0
- package/dist/components/auth/SolidChangeForcePassword.d.ts.map +1 -0
- package/dist/components/auth/SolidChangeForcePassword.js +125 -0
- package/dist/components/auth/SolidChangeForcePassword.js.map +1 -0
- package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidForgotPassword.js +54 -42
- package/dist/components/auth/SolidForgotPassword.js.map +1 -1
- package/dist/components/auth/SolidLogin.d.ts.map +1 -1
- package/dist/components/auth/SolidLogin.js +51 -38
- package/dist/components/auth/SolidLogin.js.map +1 -1
- package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -1
- package/dist/components/auth/SolidOTPVerify.js +3 -2
- package/dist/components/auth/SolidOTPVerify.js.map +1 -1
- package/dist/components/auth/SolidRegister.d.ts.map +1 -1
- package/dist/components/auth/SolidRegister.js +12 -9
- package/dist/components/auth/SolidRegister.js.map +1 -1
- package/dist/components/auth/SolidResetPassword.d.ts +4 -1
- package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
- package/dist/components/auth/SolidResetPassword.js +58 -53
- package/dist/components/auth/SolidResetPassword.js.map +1 -1
- package/dist/components/common/FilterComponent.d.ts +3 -0
- package/dist/components/common/FilterComponent.d.ts.map +1 -0
- package/dist/components/common/FilterComponent.js +214 -0
- package/dist/components/common/FilterComponent.js.map +1 -0
- package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
- package/dist/components/common/SocialMediaLogin.js +2 -2
- package/dist/components/common/SocialMediaLogin.js.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.d.ts.map +1 -1
- package/dist/components/core/common/SolidConfigureLayoutElement.js +39 -6
- package/dist/components/core/common/SolidConfigureLayoutElement.js.map +1 -1
- package/dist/components/core/filter/columns/SolidBigintField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidBigintField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidBigintField.js +8 -0
- package/dist/components/core/filter/columns/SolidBigintField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidBooleanField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidBooleanField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidBooleanField.js +27 -0
- package/dist/components/core/filter/columns/SolidBooleanField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidComputedField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidComputedField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidComputedField.js +22 -0
- package/dist/components/core/filter/columns/SolidComputedField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDateField.d.ts +9 -0
- package/dist/components/core/filter/columns/SolidDateField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDateField.js +35 -0
- package/dist/components/core/filter/columns/SolidDateField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.js +24 -0
- package/dist/components/core/filter/columns/SolidDatetimeField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidDecimalField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidDecimalField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidDecimalField.js +8 -0
- package/dist/components/core/filter/columns/SolidDecimalField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.js +25 -0
- package/dist/components/core/filter/columns/SolidExternalIdField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidFloatField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidFloatField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidFloatField.js +8 -0
- package/dist/components/core/filter/columns/SolidFloatField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidIdField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidIdField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidIdField.js +25 -0
- package/dist/components/core/filter/columns/SolidIdField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidIntField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidIntField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidIntField.js +34 -0
- package/dist/components/core/filter/columns/SolidIntField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidLongTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidLongTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidLongTextField.js +8 -0
- package/dist/components/core/filter/columns/SolidLongTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.js +35 -0
- package/dist/components/core/filter/columns/SolidMediaMultipleField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.js +35 -0
- package/dist/components/core/filter/columns/SolidMediaSingleField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidRelationField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidRelationField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidRelationField.js +12 -0
- package/dist/components/core/filter/columns/SolidRelationField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidRichTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidRichTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidRichTextField.js +8 -0
- package/dist/components/core/filter/columns/SolidRichTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.js +25 -0
- package/dist/components/core/filter/columns/SolidSelectionDynamicField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.js +26 -0
- package/dist/components/core/filter/columns/SolidSelectionStaticField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidShortTextField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidShortTextField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidShortTextField.js +33 -0
- package/dist/components/core/filter/columns/SolidShortTextField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidTimeField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidTimeField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidTimeField.js +24 -0
- package/dist/components/core/filter/columns/SolidTimeField.js.map +1 -0
- package/dist/components/core/filter/columns/SolidUuidField.d.ts +4 -0
- package/dist/components/core/filter/columns/SolidUuidField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/SolidUuidField.js +25 -0
- package/dist/components/core/filter/columns/SolidUuidField.js.map +1 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.d.ts +4 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.d.ts.map +1 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.js +54 -0
- package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.js.map +1 -0
- package/dist/components/core/list/SolidListView.d.ts.map +1 -1
- package/dist/components/core/list/SolidListView.js +31 -58
- package/dist/components/core/list/SolidListView.js.map +1 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js +3 -1
- package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDateColumn.js +5 -1
- package/dist/components/core/list/columns/SolidDateColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js +5 -1
- package/dist/components/core/list/columns/SolidDatetimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidExternalIdColumn.js +5 -1
- package/dist/components/core/list/columns/SolidExternalIdColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidIdColumn.js +5 -1
- package/dist/components/core/list/columns/SolidIdColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidIntColumn.js +5 -1
- package/dist/components/core/list/columns/SolidIntColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +5 -1
- package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js +5 -1
- package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js +5 -1
- package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.js +3 -1
- package/dist/components/core/list/columns/SolidSelectionStaticColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js +3 -1
- package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
- package/dist/components/core/list/columns/SolidTimeColumn.js +3 -1
- package/dist/components/core/list/columns/SolidTimeColumn.js.map +1 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +5 -1
- package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
- package/dist/components/core/module/CreateModule.js +2 -2
- package/dist/components/core/module/CreateModule.js.map +1 -1
- package/dist/components/layout/AppSidebar.d.ts.map +1 -1
- package/dist/components/layout/AppSidebar.js +16 -11
- package/dist/components/layout/AppSidebar.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/redux/api/authApi.d.ts +4 -1
- package/dist/redux/api/authApi.d.ts.map +1 -1
- package/dist/redux/api/authApi.js +28 -1
- package/dist/redux/api/authApi.js.map +1 -1
- package/package.json +1 -1
- package/solidstarters-solid-core-ui-1.1.2.tgz +0 -0
- package/src/components/auth/SolidChangeForcePassword.tsx +159 -0
- package/src/components/auth/SolidForgotPassword.tsx +77 -78
- package/src/components/auth/SolidLogin.tsx +110 -93
- package/src/components/auth/SolidOTPVerify.tsx +16 -14
- package/src/components/auth/SolidRegister.tsx +41 -16
- package/src/components/auth/SolidResetPassword.tsx +106 -110
- package/src/components/common/SocialMediaLogin.tsx +7 -3
- package/src/components/core/common/SolidConfigureLayoutElement.tsx +86 -15
- package/src/components/core/list/SolidListView.tsx +71 -59
- package/src/components/core/list/columns/SolidBooleanColumn.tsx +1 -1
- package/src/components/core/list/columns/SolidDateColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidDatetimeColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidExternalIdColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidIdColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidIntColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidMediaMultipleColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidMediaSingleColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidSelectionDynamicColumn.tsx +2 -2
- package/src/components/core/list/columns/SolidSelectionStaticColumn.tsx +1 -1
- package/src/components/core/list/columns/SolidShortTextColumn.tsx +3 -5
- package/src/components/core/list/columns/SolidTimeColumn.tsx +1 -1
- package/src/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +2 -2
- package/src/components/core/module/CreateModule.tsx +2 -2
- package/src/components/layout/AppSidebar.tsx +27 -21
- package/src/index.ts +1 -0
- package/src/redux/api/authApi.ts +30 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useInitiateChangePasswordMutation } from "@/redux/api/authApi";
|
|
4
|
+
import { useFormik } from "formik";
|
|
5
5
|
import Link from "next/link";
|
|
6
6
|
import { useRouter } from "next/navigation";
|
|
7
7
|
import { Button } from "primereact/button";
|
|
8
8
|
import { InputText } from "primereact/inputtext";
|
|
9
9
|
import { Message } from "primereact/message";
|
|
10
10
|
import { Toast } from "primereact/toast";
|
|
11
|
-
import { useContext, useRef
|
|
11
|
+
import { useContext, useRef } from "react";
|
|
12
12
|
import * as Yup from "yup";
|
|
13
13
|
import { LayoutContext } from "../layout/context/layoutcontext";
|
|
14
14
|
|
|
@@ -18,17 +18,6 @@ const SolidForgotPassword = () => {
|
|
|
18
18
|
const { authLayout } = layoutConfig;
|
|
19
19
|
const toast = useRef<Toast>(null);
|
|
20
20
|
const router = useRouter();
|
|
21
|
-
|
|
22
|
-
const [password, setPassword] = useState('');
|
|
23
|
-
const [checked, setChecked] = useState<boolean>(false);
|
|
24
|
-
|
|
25
|
-
const validationSchema = Yup.object({
|
|
26
|
-
email: Yup.string()
|
|
27
|
-
.email("Invalid email address")
|
|
28
|
-
.required("Email is required"),
|
|
29
|
-
password: Yup.string().required("Password is required"),
|
|
30
|
-
});
|
|
31
|
-
|
|
32
21
|
const showToast = (severity: "success" | "error", summary: string, detail: string) => {
|
|
33
22
|
toast.current?.show({
|
|
34
23
|
severity,
|
|
@@ -37,6 +26,43 @@ const SolidForgotPassword = () => {
|
|
|
37
26
|
life: 3000,
|
|
38
27
|
});
|
|
39
28
|
};
|
|
29
|
+
const [initiateChangePassword] = useInitiateChangePasswordMutation();
|
|
30
|
+
const validationSchema = Yup.object({
|
|
31
|
+
email: Yup.string()
|
|
32
|
+
.email('Invalid email format')
|
|
33
|
+
.required('Email is required'),
|
|
34
|
+
});
|
|
35
|
+
function maskEmail(email: string) {
|
|
36
|
+
const [localPart, domain] = email.split('@');
|
|
37
|
+
const maskedLocal = localPart.slice(0, 3) + '*'.repeat(localPart.length - 3);
|
|
38
|
+
const maskedDomain = domain.slice(-8).padStart(domain.length, '*');
|
|
39
|
+
return `${maskedLocal}@${maskedDomain}`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const formik = useFormik({
|
|
43
|
+
initialValues: {
|
|
44
|
+
email: "",
|
|
45
|
+
},
|
|
46
|
+
validationSchema,
|
|
47
|
+
onSubmit: async (values) => {
|
|
48
|
+
try {
|
|
49
|
+
const payload = {
|
|
50
|
+
email: values.email,
|
|
51
|
+
};
|
|
52
|
+
const response = await initiateChangePassword(payload).unwrap();
|
|
53
|
+
if (response?.statusCode === 200) {
|
|
54
|
+
const email = response?.data?.data?.user?.email;
|
|
55
|
+
const maskedEmail = maskEmail(email);
|
|
56
|
+
router.push(`/auth/initiate-forgot-password-thank-you?email=${maskedEmail}`)
|
|
57
|
+
} else (
|
|
58
|
+
showToast("error", "Login Error", response.error)
|
|
59
|
+
)
|
|
60
|
+
} catch (err: any) {
|
|
61
|
+
console.log("Error", err);
|
|
62
|
+
showToast("error", "Login Error", err?.data ? err?.data?.message : "Something Went Wrong");
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
});
|
|
40
66
|
|
|
41
67
|
const isFormFieldValid = (formik: any, fieldName: string) =>
|
|
42
68
|
formik.touched[fieldName] && formik.errors[fieldName];
|
|
@@ -45,72 +71,45 @@ const SolidForgotPassword = () => {
|
|
|
45
71
|
<>
|
|
46
72
|
<Toast ref={toast} />
|
|
47
73
|
<div className={`auth-container ${authLayout === 'Center' ? 'center' : 'side'}`}>
|
|
48
|
-
|
|
49
|
-
<div className="
|
|
50
|
-
<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
74
|
+
{authLayout === 'Center' &&
|
|
75
|
+
<div className="flex justify-content-center">
|
|
76
|
+
<div className="solid-logo flex align-items-center gap-3">
|
|
77
|
+
<img
|
|
78
|
+
alt="solid logo"
|
|
79
|
+
src={'/images/SS-Logo-1 1.png'}
|
|
80
|
+
className="position-relative img-fluid"
|
|
81
|
+
/>
|
|
82
|
+
<div>
|
|
83
|
+
<p className="solid-logo-title">
|
|
84
|
+
Solid<br />Starters
|
|
85
|
+
</p>
|
|
86
|
+
</div>
|
|
59
87
|
</div>
|
|
60
88
|
</div>
|
|
61
|
-
|
|
62
|
-
<h2 className=
|
|
63
|
-
<p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p>
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
router.push("/admin/core/solid-core/user/list");
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
}}
|
|
89
|
-
>
|
|
90
|
-
{(formik) => (
|
|
91
|
-
<Form>
|
|
92
|
-
<div className="flex flex-column gap-2">
|
|
93
|
-
<label htmlFor="email" className="solid-auth-input-label">Username or Email</label>
|
|
94
|
-
<InputText
|
|
95
|
-
id="email"
|
|
96
|
-
name="email"
|
|
97
|
-
placeholder="Email ID"
|
|
98
|
-
onChange={formik.handleChange}
|
|
99
|
-
value={formik.values.email}
|
|
100
|
-
/>
|
|
101
|
-
{isFormFieldValid(formik, "email") && <Message
|
|
102
|
-
className="text-red-500 text-sm"
|
|
103
|
-
severity="error"
|
|
104
|
-
text={formik?.errors?.email?.toString()}
|
|
105
|
-
/>}
|
|
106
|
-
</div>
|
|
107
|
-
<div className="mt-4">
|
|
108
|
-
<Button className="w-full font-light" label="Send OTP" />
|
|
109
|
-
</div>
|
|
110
|
-
</Form>
|
|
111
|
-
)}
|
|
112
|
-
</Formik>
|
|
113
|
-
</>
|
|
89
|
+
}
|
|
90
|
+
<h2 className={`solid-auth-title ${authLayout === 'Center' ? 'text-center' : 'text-left'}`}>Forgot Password</h2>
|
|
91
|
+
{/* <p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p> */}
|
|
92
|
+
<form onSubmit={formik.handleSubmit}>
|
|
93
|
+
<div className="flex flex-column gap-2">
|
|
94
|
+
<label htmlFor="email" className="solid-auth-input-label">Username or Email</label>
|
|
95
|
+
<InputText
|
|
96
|
+
id="email"
|
|
97
|
+
name="email"
|
|
98
|
+
placeholder="Email ID"
|
|
99
|
+
value={formik.values.email}
|
|
100
|
+
onChange={formik.handleChange}
|
|
101
|
+
onBlur={formik.handleBlur}
|
|
102
|
+
/>
|
|
103
|
+
{isFormFieldValid(formik, "email") && <Message
|
|
104
|
+
className="text-red-500 text-sm"
|
|
105
|
+
severity="error"
|
|
106
|
+
text={formik?.errors?.email?.toString()}
|
|
107
|
+
/>}
|
|
108
|
+
</div>
|
|
109
|
+
<div className="mt-4">
|
|
110
|
+
<Button className="w-full font-light auth-submit-button" label="Send OTP" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
|
|
111
|
+
</div>
|
|
112
|
+
</form>
|
|
114
113
|
</div>
|
|
115
114
|
<div className="text-center mt-5">
|
|
116
115
|
<div className="text-sm text-400 secondary-dark-color">
|
|
@@ -5,13 +5,16 @@ import { signIn } from "next-auth/react";
|
|
|
5
5
|
import Link from "next/link";
|
|
6
6
|
import { useRouter } from "next/navigation";
|
|
7
7
|
import { Button } from "primereact/button";
|
|
8
|
+
import { Divider } from "primereact/divider";
|
|
8
9
|
import { InputText } from "primereact/inputtext";
|
|
9
10
|
import { Message } from "primereact/message";
|
|
10
11
|
import { Password } from "primereact/password";
|
|
12
|
+
import { TabPanel, TabView } from 'primereact/tabview';
|
|
11
13
|
import { Toast } from "primereact/toast";
|
|
12
14
|
import { classNames } from "primereact/utils";
|
|
13
15
|
import { useContext, useRef, useState } from "react";
|
|
14
16
|
import * as Yup from "yup";
|
|
17
|
+
import { SocialMediaLogin } from "../common/SocialMediaLogin";
|
|
15
18
|
import { LayoutContext } from "../layout/context/layoutcontext";
|
|
16
19
|
|
|
17
20
|
|
|
@@ -22,7 +25,6 @@ const SolidLogin = () => {
|
|
|
22
25
|
const router = useRouter();
|
|
23
26
|
|
|
24
27
|
const [password, setPassword] = useState('');
|
|
25
|
-
const [checked, setChecked] = useState<boolean>(false);
|
|
26
28
|
|
|
27
29
|
const validationSchema = Yup.object({
|
|
28
30
|
email: Yup.string()
|
|
@@ -47,108 +49,123 @@ const SolidLogin = () => {
|
|
|
47
49
|
<div className="">
|
|
48
50
|
<Toast ref={toast} />
|
|
49
51
|
<div className={`auth-container ${authLayout === 'Center' ? 'center' : 'side'}`}>
|
|
50
|
-
|
|
51
|
-
<div className="
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
{authLayout === 'Center' &&
|
|
53
|
+
<div className="flex justify-content-center">
|
|
54
|
+
<div className="solid-logo flex align-items-center gap-3">
|
|
55
|
+
<img
|
|
56
|
+
alt="solid logo"
|
|
57
|
+
src={'/images/SS-Logo-1 1.png'}
|
|
58
|
+
className="position-relative img-fluid"
|
|
59
|
+
/>
|
|
60
|
+
<div>
|
|
61
|
+
<p className="solid-logo-title">
|
|
62
|
+
Solid<br />Starters
|
|
63
|
+
</p>
|
|
64
|
+
</div>
|
|
61
65
|
</div>
|
|
62
66
|
</div>
|
|
63
|
-
|
|
64
|
-
<h2 className=
|
|
65
|
-
<p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p>
|
|
66
|
-
<>
|
|
67
|
-
<Formik
|
|
68
|
-
initialValues={{
|
|
69
|
-
email: "",
|
|
70
|
-
password: "",
|
|
71
|
-
}}
|
|
72
|
-
validationSchema={validationSchema}
|
|
73
|
-
onSubmit={async (values) => {
|
|
74
|
-
// Handle form submission
|
|
75
|
-
const email = values.email;
|
|
76
|
-
const password = values.password;
|
|
67
|
+
}
|
|
68
|
+
<h2 className={`solid-auth-title ${authLayout === 'Center' ? 'text-center' : 'text-left'}`}>Sign In To Your Account</h2>
|
|
69
|
+
{/* <p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p> */}
|
|
77
70
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
<TabView>
|
|
72
|
+
<TabPanel header="Login With Password">
|
|
73
|
+
<Formik
|
|
74
|
+
initialValues={{
|
|
75
|
+
email: "",
|
|
76
|
+
password: "",
|
|
77
|
+
}}
|
|
78
|
+
validationSchema={validationSchema}
|
|
79
|
+
onSubmit={async (values, { setSubmitting }) => {
|
|
80
|
+
try {
|
|
81
|
+
const response = await signIn("credentials", {
|
|
82
|
+
redirect: false,
|
|
83
|
+
email: values.email,
|
|
84
|
+
password: values.password,
|
|
85
|
+
});
|
|
89
86
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
formik
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
87
|
+
if (response?.error) {
|
|
88
|
+
showToast("error", "Login Error", response.error);
|
|
89
|
+
} else {
|
|
90
|
+
showToast("success", "Login Success", "Redirecting to dashboard...");
|
|
91
|
+
router.push("http://localhost:3001/admin/core/solid-core/user/list");
|
|
92
|
+
}
|
|
93
|
+
} catch (error) {
|
|
94
|
+
showToast("error", "Login Failed", "Something went wrong");
|
|
95
|
+
} finally {
|
|
96
|
+
setSubmitting(false); // Re-enable the button after submission
|
|
97
|
+
}
|
|
98
|
+
}}
|
|
99
|
+
>
|
|
100
|
+
{(formik) => (
|
|
101
|
+
<Form>
|
|
102
|
+
<div className="flex flex-column gap-2">
|
|
103
|
+
<label htmlFor="email" className="solid-auth-input-label">Username or Email</label>
|
|
104
|
+
<InputText
|
|
105
|
+
id="email"
|
|
106
|
+
name="email"
|
|
107
|
+
placeholder="Email ID"
|
|
108
|
+
onChange={formik.handleChange}
|
|
109
|
+
value={formik.values.email}
|
|
110
|
+
/>
|
|
111
|
+
{isFormFieldValid(formik, "email") && <Message
|
|
112
|
+
className="text-red-500 text-sm"
|
|
113
|
+
severity="error"
|
|
114
|
+
text={formik?.errors?.email?.toString()}
|
|
115
|
+
/>}
|
|
116
|
+
</div>
|
|
117
|
+
<div className="flex flex-column gap-2 mt-4" style={{}}>
|
|
118
|
+
<label htmlFor="password" className="solid-auth-input-label">Password</label>
|
|
119
|
+
<Password
|
|
120
|
+
id="password"
|
|
121
|
+
placeholder="***************"
|
|
122
|
+
value={password}
|
|
123
|
+
onChange={(e) => {
|
|
124
|
+
setPassword(e.target.value);
|
|
125
|
+
formik.setFieldValue("password", e.target.value);
|
|
126
|
+
}}
|
|
127
|
+
toggleMask
|
|
128
|
+
className={classNames("", {
|
|
129
|
+
"p-invalid": isFormFieldValid(formik, "password"),
|
|
130
|
+
})}
|
|
131
|
+
inputClassName="w-full"
|
|
132
|
+
feedback={false}
|
|
133
|
+
/>
|
|
134
|
+
{isFormFieldValid(formik, "password") && <Message
|
|
135
|
+
className="text-red-500 text-sm"
|
|
136
|
+
severity="error"
|
|
137
|
+
text={formik?.errors?.password?.toString()}
|
|
138
|
+
/>}
|
|
139
|
+
</div>
|
|
140
|
+
{/* <div className="flex align-items-center mt-4">
|
|
133
141
|
<Checkbox inputId="remember" onChange={(e: any) => setChecked(e.checked)} checked={checked} />
|
|
134
142
|
<label htmlFor="remember" className="ml-2">Remember me</label>
|
|
135
143
|
</div> */}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
<div className="mt-4 text-right">
|
|
145
|
+
<Link href={"/auth/initiate-forgot-password"} className="solid-auth-input-label">Forgot Password?</Link>
|
|
146
|
+
</div>
|
|
147
|
+
<div className="mt-4">
|
|
148
|
+
<Button className="w-full font-light auth-submit-button" label="Sign In" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
|
|
149
|
+
</div>
|
|
150
|
+
</Form>
|
|
151
|
+
)}
|
|
152
|
+
</Formik>
|
|
153
|
+
</TabPanel>
|
|
154
|
+
<TabPanel header="Login Without Password">
|
|
155
|
+
</TabPanel>
|
|
156
|
+
</TabView>
|
|
157
|
+
<Divider align="center">
|
|
158
|
+
<div className="inline-flex align-items-center">
|
|
159
|
+
or
|
|
160
|
+
</div>
|
|
161
|
+
</Divider>
|
|
162
|
+
<SocialMediaLogin />
|
|
146
163
|
</div>
|
|
147
|
-
<div className="
|
|
148
|
-
<div className="text-sm text-400 secondary-dark-color">
|
|
164
|
+
{/* <div className=" mt-5">
|
|
165
|
+
<div className="text-sm text-center text-400 secondary-dark-color">
|
|
149
166
|
Don’t have an account ? <Link className="font-bold" href="/auth/register">Sign Up</Link>
|
|
150
167
|
</div>
|
|
151
|
-
</div>
|
|
168
|
+
</div> */}
|
|
152
169
|
</div>
|
|
153
170
|
);
|
|
154
171
|
};
|
|
@@ -46,21 +46,23 @@ const SolidOTPVerify = () => {
|
|
|
46
46
|
<>
|
|
47
47
|
<Toast ref={toast} />
|
|
48
48
|
<div className={`auth-container ${authLayout === 'Center' ? 'center' : 'side'}`} style={{ minWidth: 480 }}>
|
|
49
|
-
|
|
50
|
-
<div className="
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
{authLayout === 'Center' &&
|
|
50
|
+
<div className="flex justify-content-center">
|
|
51
|
+
<div className="solid-logo flex align-items-center gap-3">
|
|
52
|
+
<img
|
|
53
|
+
alt="solid logo"
|
|
54
|
+
src={'/images/SS-Logo-1 1.png'}
|
|
55
|
+
className="position-relative img-fluid"
|
|
56
|
+
/>
|
|
57
|
+
<div>
|
|
58
|
+
<p className="solid-logo-title">
|
|
59
|
+
Solid<br />Starters
|
|
60
|
+
</p>
|
|
61
|
+
</div>
|
|
60
62
|
</div>
|
|
61
63
|
</div>
|
|
62
|
-
|
|
63
|
-
<h2 className=
|
|
64
|
+
}
|
|
65
|
+
<h2 className={`solid-auth-title ${authLayout === 'Center' ? 'text-center' : 'text-left'}`}>OTP Verification</h2>
|
|
64
66
|
<p className="solid-auth-subtitle text-sm">
|
|
65
67
|
Please enter the OTP sent to your email to complete verification
|
|
66
68
|
</p>
|
|
@@ -108,7 +110,7 @@ const SolidOTPVerify = () => {
|
|
|
108
110
|
</div>
|
|
109
111
|
</div>
|
|
110
112
|
<div className="mt-4">
|
|
111
|
-
<Button type="submit" className="w-full font-light" label="Verify" />
|
|
113
|
+
<Button type="submit" className="w-full font-light auth-submit-button" label="Verify" disabled={formik.isSubmitting} loading={formik.isSubmitting}/>
|
|
112
114
|
</div>
|
|
113
115
|
</Form>
|
|
114
116
|
)}
|
|
@@ -6,6 +6,7 @@ import { useFormik } from "formik";
|
|
|
6
6
|
import Link from "next/link";
|
|
7
7
|
import { useRouter } from "next/navigation";
|
|
8
8
|
import { Button } from "primereact/button";
|
|
9
|
+
import { Divider } from "primereact/divider";
|
|
9
10
|
import { InputText } from "primereact/inputtext";
|
|
10
11
|
import { Message } from "primereact/message";
|
|
11
12
|
import { Password } from "primereact/password";
|
|
@@ -13,6 +14,7 @@ import { Toast } from "primereact/toast";
|
|
|
13
14
|
import { classNames } from "primereact/utils";
|
|
14
15
|
import { ChangeEventHandler, useContext, useEffect, useRef, useState } from "react";
|
|
15
16
|
import * as Yup from "yup";
|
|
17
|
+
import { SocialMediaLogin } from "../common/SocialMediaLogin";
|
|
16
18
|
import { LayoutContext } from "../layout/context/layoutcontext";
|
|
17
19
|
|
|
18
20
|
const SolidRegister = () => {
|
|
@@ -113,25 +115,27 @@ const SolidRegister = () => {
|
|
|
113
115
|
<>
|
|
114
116
|
<Toast ref={toast} />
|
|
115
117
|
<div className={`auth-container ${authLayout === 'Center' ? 'center' : 'side'}`}>
|
|
116
|
-
|
|
117
|
-
<div className="
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
118
|
+
{authLayout === 'Center' &&
|
|
119
|
+
<div className="flex justify-content-center">
|
|
120
|
+
<div className="solid-logo flex align-items-center gap-3">
|
|
121
|
+
<img
|
|
122
|
+
alt="solid logo"
|
|
123
|
+
src={'/images/SS-Logo-1 1.png'}
|
|
124
|
+
className="position-relative img-fluid"
|
|
125
|
+
/>
|
|
126
|
+
<div>
|
|
127
|
+
<p className="solid-logo-title">
|
|
128
|
+
Solid<br />Starters
|
|
129
|
+
</p>
|
|
130
|
+
</div>
|
|
127
131
|
</div>
|
|
128
132
|
</div>
|
|
129
|
-
|
|
130
|
-
<h2 className=
|
|
131
|
-
<p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p>
|
|
133
|
+
}
|
|
134
|
+
<h2 className={`solid-auth-title ${authLayout === 'Center' ? 'text-center' : 'text-left'}`}>Sign Up To Your Account</h2>
|
|
135
|
+
{/* <p className="solid-auth-subtitle text-sm">By continuing, you agree to the <Link href={'#'}>Terms of Service</Link> and acknowledge you’ve read our <Link href={'#'}>Privacy Policy.</Link> </p> */}
|
|
132
136
|
<>
|
|
133
137
|
<form onSubmit={formik.handleSubmit}>
|
|
134
|
-
<div className="grid">
|
|
138
|
+
{/* <div className="grid">
|
|
135
139
|
<div className="col-6">
|
|
136
140
|
<div className="flex flex-column gap-2">
|
|
137
141
|
<label htmlFor="email" className="solid-auth-input-label">First Name</label>
|
|
@@ -166,6 +170,21 @@ const SolidRegister = () => {
|
|
|
166
170
|
/>}
|
|
167
171
|
</div>
|
|
168
172
|
</div>
|
|
173
|
+
</div> */}
|
|
174
|
+
<div className="flex flex-column gap-2 mt-3">
|
|
175
|
+
<label htmlFor="email" className="solid-auth-input-label">Username</label>
|
|
176
|
+
<InputText
|
|
177
|
+
id="username"
|
|
178
|
+
name="username"
|
|
179
|
+
placeholder="username"
|
|
180
|
+
onChange={formik.handleChange}
|
|
181
|
+
value={formik.values.username}
|
|
182
|
+
/>
|
|
183
|
+
{isFormFieldValid(formik, "username") && <Message
|
|
184
|
+
className="text-red-500 text-sm"
|
|
185
|
+
severity="error"
|
|
186
|
+
text={formik?.errors?.username?.toString()}
|
|
187
|
+
/>}
|
|
169
188
|
</div>
|
|
170
189
|
<div className="flex flex-column gap-2 mt-3">
|
|
171
190
|
<label htmlFor="email" className="solid-auth-input-label">Email</label>
|
|
@@ -204,10 +223,16 @@ const SolidRegister = () => {
|
|
|
204
223
|
/>}
|
|
205
224
|
</div>
|
|
206
225
|
<div className="mt-4">
|
|
207
|
-
<Button className="w-full font-light" label="Sign Up" />
|
|
226
|
+
<Button className="w-full font-light auth-submit-button" label="Sign Up" disabled={formik.isSubmitting} loading={formik.isSubmitting} />
|
|
208
227
|
</div>
|
|
209
228
|
</form>
|
|
210
229
|
</>
|
|
230
|
+
<Divider align="center">
|
|
231
|
+
<div className="inline-flex align-items-center">
|
|
232
|
+
or
|
|
233
|
+
</div>
|
|
234
|
+
</Divider>
|
|
235
|
+
<SocialMediaLogin />
|
|
211
236
|
</div>
|
|
212
237
|
<div className="text-center mt-5">
|
|
213
238
|
<div className="text-sm text-400 secondary-dark-color">
|