@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.
Files changed (185) hide show
  1. package/dist/components/auth/SolidChangeForcePassword.d.ts +3 -0
  2. package/dist/components/auth/SolidChangeForcePassword.d.ts.map +1 -0
  3. package/dist/components/auth/SolidChangeForcePassword.js +125 -0
  4. package/dist/components/auth/SolidChangeForcePassword.js.map +1 -0
  5. package/dist/components/auth/SolidForgotPassword.d.ts.map +1 -1
  6. package/dist/components/auth/SolidForgotPassword.js +54 -42
  7. package/dist/components/auth/SolidForgotPassword.js.map +1 -1
  8. package/dist/components/auth/SolidLogin.d.ts.map +1 -1
  9. package/dist/components/auth/SolidLogin.js +51 -38
  10. package/dist/components/auth/SolidLogin.js.map +1 -1
  11. package/dist/components/auth/SolidOTPVerify.d.ts.map +1 -1
  12. package/dist/components/auth/SolidOTPVerify.js +3 -2
  13. package/dist/components/auth/SolidOTPVerify.js.map +1 -1
  14. package/dist/components/auth/SolidRegister.d.ts.map +1 -1
  15. package/dist/components/auth/SolidRegister.js +12 -9
  16. package/dist/components/auth/SolidRegister.js.map +1 -1
  17. package/dist/components/auth/SolidResetPassword.d.ts +4 -1
  18. package/dist/components/auth/SolidResetPassword.d.ts.map +1 -1
  19. package/dist/components/auth/SolidResetPassword.js +58 -53
  20. package/dist/components/auth/SolidResetPassword.js.map +1 -1
  21. package/dist/components/common/FilterComponent.d.ts +3 -0
  22. package/dist/components/common/FilterComponent.d.ts.map +1 -0
  23. package/dist/components/common/FilterComponent.js +214 -0
  24. package/dist/components/common/FilterComponent.js.map +1 -0
  25. package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
  26. package/dist/components/common/SocialMediaLogin.js +2 -2
  27. package/dist/components/common/SocialMediaLogin.js.map +1 -1
  28. package/dist/components/core/common/SolidConfigureLayoutElement.d.ts.map +1 -1
  29. package/dist/components/core/common/SolidConfigureLayoutElement.js +39 -6
  30. package/dist/components/core/common/SolidConfigureLayoutElement.js.map +1 -1
  31. package/dist/components/core/filter/columns/SolidBigintField.d.ts +4 -0
  32. package/dist/components/core/filter/columns/SolidBigintField.d.ts.map +1 -0
  33. package/dist/components/core/filter/columns/SolidBigintField.js +8 -0
  34. package/dist/components/core/filter/columns/SolidBigintField.js.map +1 -0
  35. package/dist/components/core/filter/columns/SolidBooleanField.d.ts +4 -0
  36. package/dist/components/core/filter/columns/SolidBooleanField.d.ts.map +1 -0
  37. package/dist/components/core/filter/columns/SolidBooleanField.js +27 -0
  38. package/dist/components/core/filter/columns/SolidBooleanField.js.map +1 -0
  39. package/dist/components/core/filter/columns/SolidComputedField.d.ts +4 -0
  40. package/dist/components/core/filter/columns/SolidComputedField.d.ts.map +1 -0
  41. package/dist/components/core/filter/columns/SolidComputedField.js +22 -0
  42. package/dist/components/core/filter/columns/SolidComputedField.js.map +1 -0
  43. package/dist/components/core/filter/columns/SolidDateField.d.ts +9 -0
  44. package/dist/components/core/filter/columns/SolidDateField.d.ts.map +1 -0
  45. package/dist/components/core/filter/columns/SolidDateField.js +35 -0
  46. package/dist/components/core/filter/columns/SolidDateField.js.map +1 -0
  47. package/dist/components/core/filter/columns/SolidDatetimeField.d.ts +4 -0
  48. package/dist/components/core/filter/columns/SolidDatetimeField.d.ts.map +1 -0
  49. package/dist/components/core/filter/columns/SolidDatetimeField.js +24 -0
  50. package/dist/components/core/filter/columns/SolidDatetimeField.js.map +1 -0
  51. package/dist/components/core/filter/columns/SolidDecimalField.d.ts +4 -0
  52. package/dist/components/core/filter/columns/SolidDecimalField.d.ts.map +1 -0
  53. package/dist/components/core/filter/columns/SolidDecimalField.js +8 -0
  54. package/dist/components/core/filter/columns/SolidDecimalField.js.map +1 -0
  55. package/dist/components/core/filter/columns/SolidExternalIdField.d.ts +4 -0
  56. package/dist/components/core/filter/columns/SolidExternalIdField.d.ts.map +1 -0
  57. package/dist/components/core/filter/columns/SolidExternalIdField.js +25 -0
  58. package/dist/components/core/filter/columns/SolidExternalIdField.js.map +1 -0
  59. package/dist/components/core/filter/columns/SolidFloatField.d.ts +4 -0
  60. package/dist/components/core/filter/columns/SolidFloatField.d.ts.map +1 -0
  61. package/dist/components/core/filter/columns/SolidFloatField.js +8 -0
  62. package/dist/components/core/filter/columns/SolidFloatField.js.map +1 -0
  63. package/dist/components/core/filter/columns/SolidIdField.d.ts +4 -0
  64. package/dist/components/core/filter/columns/SolidIdField.d.ts.map +1 -0
  65. package/dist/components/core/filter/columns/SolidIdField.js +25 -0
  66. package/dist/components/core/filter/columns/SolidIdField.js.map +1 -0
  67. package/dist/components/core/filter/columns/SolidIntField.d.ts +4 -0
  68. package/dist/components/core/filter/columns/SolidIntField.d.ts.map +1 -0
  69. package/dist/components/core/filter/columns/SolidIntField.js +34 -0
  70. package/dist/components/core/filter/columns/SolidIntField.js.map +1 -0
  71. package/dist/components/core/filter/columns/SolidLongTextField.d.ts +4 -0
  72. package/dist/components/core/filter/columns/SolidLongTextField.d.ts.map +1 -0
  73. package/dist/components/core/filter/columns/SolidLongTextField.js +8 -0
  74. package/dist/components/core/filter/columns/SolidLongTextField.js.map +1 -0
  75. package/dist/components/core/filter/columns/SolidMediaMultipleField.d.ts +4 -0
  76. package/dist/components/core/filter/columns/SolidMediaMultipleField.d.ts.map +1 -0
  77. package/dist/components/core/filter/columns/SolidMediaMultipleField.js +35 -0
  78. package/dist/components/core/filter/columns/SolidMediaMultipleField.js.map +1 -0
  79. package/dist/components/core/filter/columns/SolidMediaSingleField.d.ts +4 -0
  80. package/dist/components/core/filter/columns/SolidMediaSingleField.d.ts.map +1 -0
  81. package/dist/components/core/filter/columns/SolidMediaSingleField.js +35 -0
  82. package/dist/components/core/filter/columns/SolidMediaSingleField.js.map +1 -0
  83. package/dist/components/core/filter/columns/SolidRelationField.d.ts +4 -0
  84. package/dist/components/core/filter/columns/SolidRelationField.d.ts.map +1 -0
  85. package/dist/components/core/filter/columns/SolidRelationField.js +12 -0
  86. package/dist/components/core/filter/columns/SolidRelationField.js.map +1 -0
  87. package/dist/components/core/filter/columns/SolidRichTextField.d.ts +4 -0
  88. package/dist/components/core/filter/columns/SolidRichTextField.d.ts.map +1 -0
  89. package/dist/components/core/filter/columns/SolidRichTextField.js +8 -0
  90. package/dist/components/core/filter/columns/SolidRichTextField.js.map +1 -0
  91. package/dist/components/core/filter/columns/SolidSelectionDynamicField.d.ts +4 -0
  92. package/dist/components/core/filter/columns/SolidSelectionDynamicField.d.ts.map +1 -0
  93. package/dist/components/core/filter/columns/SolidSelectionDynamicField.js +25 -0
  94. package/dist/components/core/filter/columns/SolidSelectionDynamicField.js.map +1 -0
  95. package/dist/components/core/filter/columns/SolidSelectionStaticField.d.ts +4 -0
  96. package/dist/components/core/filter/columns/SolidSelectionStaticField.d.ts.map +1 -0
  97. package/dist/components/core/filter/columns/SolidSelectionStaticField.js +26 -0
  98. package/dist/components/core/filter/columns/SolidSelectionStaticField.js.map +1 -0
  99. package/dist/components/core/filter/columns/SolidShortTextField.d.ts +4 -0
  100. package/dist/components/core/filter/columns/SolidShortTextField.d.ts.map +1 -0
  101. package/dist/components/core/filter/columns/SolidShortTextField.js +33 -0
  102. package/dist/components/core/filter/columns/SolidShortTextField.js.map +1 -0
  103. package/dist/components/core/filter/columns/SolidTimeField.d.ts +4 -0
  104. package/dist/components/core/filter/columns/SolidTimeField.d.ts.map +1 -0
  105. package/dist/components/core/filter/columns/SolidTimeField.js +24 -0
  106. package/dist/components/core/filter/columns/SolidTimeField.js.map +1 -0
  107. package/dist/components/core/filter/columns/SolidUuidField.d.ts +4 -0
  108. package/dist/components/core/filter/columns/SolidUuidField.d.ts.map +1 -0
  109. package/dist/components/core/filter/columns/SolidUuidField.js +25 -0
  110. package/dist/components/core/filter/columns/SolidUuidField.js.map +1 -0
  111. package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.d.ts +4 -0
  112. package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.d.ts.map +1 -0
  113. package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.js +54 -0
  114. package/dist/components/core/filter/columns/relations/SolidRelationManyToOneField.js.map +1 -0
  115. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  116. package/dist/components/core/list/SolidListView.js +31 -58
  117. package/dist/components/core/list/SolidListView.js.map +1 -1
  118. package/dist/components/core/list/columns/SolidBooleanColumn.js +3 -1
  119. package/dist/components/core/list/columns/SolidBooleanColumn.js.map +1 -1
  120. package/dist/components/core/list/columns/SolidDateColumn.js +5 -1
  121. package/dist/components/core/list/columns/SolidDateColumn.js.map +1 -1
  122. package/dist/components/core/list/columns/SolidDatetimeColumn.js +5 -1
  123. package/dist/components/core/list/columns/SolidDatetimeColumn.js.map +1 -1
  124. package/dist/components/core/list/columns/SolidExternalIdColumn.js +5 -1
  125. package/dist/components/core/list/columns/SolidExternalIdColumn.js.map +1 -1
  126. package/dist/components/core/list/columns/SolidIdColumn.js +5 -1
  127. package/dist/components/core/list/columns/SolidIdColumn.js.map +1 -1
  128. package/dist/components/core/list/columns/SolidIntColumn.js +5 -1
  129. package/dist/components/core/list/columns/SolidIntColumn.js.map +1 -1
  130. package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +5 -1
  131. package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
  132. package/dist/components/core/list/columns/SolidMediaSingleColumn.js +5 -1
  133. package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
  134. package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js +5 -1
  135. package/dist/components/core/list/columns/SolidSelectionDynamicColumn.js.map +1 -1
  136. package/dist/components/core/list/columns/SolidSelectionStaticColumn.js +3 -1
  137. package/dist/components/core/list/columns/SolidSelectionStaticColumn.js.map +1 -1
  138. package/dist/components/core/list/columns/SolidShortTextColumn.d.ts.map +1 -1
  139. package/dist/components/core/list/columns/SolidShortTextColumn.js +3 -1
  140. package/dist/components/core/list/columns/SolidShortTextColumn.js.map +1 -1
  141. package/dist/components/core/list/columns/SolidTimeColumn.js +3 -1
  142. package/dist/components/core/list/columns/SolidTimeColumn.js.map +1 -1
  143. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js +5 -1
  144. package/dist/components/core/list/columns/relations/SolidRelationManyToOneColumn.js.map +1 -1
  145. package/dist/components/core/module/CreateModule.js +2 -2
  146. package/dist/components/core/module/CreateModule.js.map +1 -1
  147. package/dist/components/layout/AppSidebar.d.ts.map +1 -1
  148. package/dist/components/layout/AppSidebar.js +16 -11
  149. package/dist/components/layout/AppSidebar.js.map +1 -1
  150. package/dist/index.d.ts +1 -0
  151. package/dist/index.d.ts.map +1 -1
  152. package/dist/index.js +3 -2
  153. package/dist/index.js.map +1 -1
  154. package/dist/redux/api/authApi.d.ts +4 -1
  155. package/dist/redux/api/authApi.d.ts.map +1 -1
  156. package/dist/redux/api/authApi.js +28 -1
  157. package/dist/redux/api/authApi.js.map +1 -1
  158. package/package.json +1 -1
  159. package/solidstarters-solid-core-ui-1.1.2.tgz +0 -0
  160. package/src/components/auth/SolidChangeForcePassword.tsx +159 -0
  161. package/src/components/auth/SolidForgotPassword.tsx +77 -78
  162. package/src/components/auth/SolidLogin.tsx +110 -93
  163. package/src/components/auth/SolidOTPVerify.tsx +16 -14
  164. package/src/components/auth/SolidRegister.tsx +41 -16
  165. package/src/components/auth/SolidResetPassword.tsx +106 -110
  166. package/src/components/common/SocialMediaLogin.tsx +7 -3
  167. package/src/components/core/common/SolidConfigureLayoutElement.tsx +86 -15
  168. package/src/components/core/list/SolidListView.tsx +71 -59
  169. package/src/components/core/list/columns/SolidBooleanColumn.tsx +1 -1
  170. package/src/components/core/list/columns/SolidDateColumn.tsx +2 -2
  171. package/src/components/core/list/columns/SolidDatetimeColumn.tsx +2 -2
  172. package/src/components/core/list/columns/SolidExternalIdColumn.tsx +2 -2
  173. package/src/components/core/list/columns/SolidIdColumn.tsx +2 -2
  174. package/src/components/core/list/columns/SolidIntColumn.tsx +2 -2
  175. package/src/components/core/list/columns/SolidMediaMultipleColumn.tsx +2 -2
  176. package/src/components/core/list/columns/SolidMediaSingleColumn.tsx +2 -2
  177. package/src/components/core/list/columns/SolidSelectionDynamicColumn.tsx +2 -2
  178. package/src/components/core/list/columns/SolidSelectionStaticColumn.tsx +1 -1
  179. package/src/components/core/list/columns/SolidShortTextColumn.tsx +3 -5
  180. package/src/components/core/list/columns/SolidTimeColumn.tsx +1 -1
  181. package/src/components/core/list/columns/relations/SolidRelationManyToOneColumn.tsx +2 -2
  182. package/src/components/core/module/CreateModule.tsx +2 -2
  183. package/src/components/layout/AppSidebar.tsx +27 -21
  184. package/src/index.ts +1 -0
  185. package/src/redux/api/authApi.ts +30 -0
@@ -1,14 +1,14 @@
1
1
  "use client";
2
2
 
3
- import { Form, Formik } from "formik";
4
- import { signIn } from "next-auth/react";
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, useState } from "react";
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
- <div className="flex justify-content-center">
49
- <div className="solid-logo flex align-items-center gap-3">
50
- <img
51
- alt="solid logo"
52
- src={'/images/SS-Logo-1 1.png'}
53
- className="position-relative img-fluid"
54
- />
55
- <div>
56
- <p className="solid-logo-title">
57
- Solid<br />Starters
58
- </p>
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
- </div>
62
- <h2 className="solid-auth-title text-center">Forgot Password</h2>
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
- <Formik
66
- initialValues={{
67
- email: "",
68
- password: "",
69
- }}
70
- validationSchema={validationSchema}
71
- onSubmit={async (values) => {
72
- // Handle form submission
73
- const email = values.email;
74
- const password = values.password;
75
-
76
- const response = await signIn("credentials", {
77
- redirect: false,
78
- email,
79
- password,
80
- });
81
- if (response?.error) {
82
- showToast("error", "Login Error", response.error);
83
- } else {
84
- showToast("success", "Login Success", "Redirecting to dashboard...");
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
- <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>
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
- </div>
64
- <h2 className="solid-auth-title text-center">Sign In To Your Account</h2>
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
- const response = await signIn("credentials", {
79
- redirect: false,
80
- email,
81
- password,
82
- });
83
- if (response?.error) {
84
- showToast("error", "Login Error", response.error);
85
- } else {
86
- showToast("success", "Login Success", "Redirecting to dashboard...");
87
- router.push("/admin/core/solid-core/user/list");
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
- {(formik) => (
93
- <Form>
94
- <div className="flex flex-column gap-2">
95
- <label htmlFor="email" className="solid-auth-input-label">Username or Email</label>
96
- <InputText
97
- id="email"
98
- name="email"
99
- placeholder="Email ID"
100
- onChange={formik.handleChange}
101
- value={formik.values.email}
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="flex flex-column gap-2 mt-4" style={{}}>
110
- <label htmlFor="password" className="solid-auth-input-label">Password</label>
111
- <Password
112
- id="password"
113
- placeholder="***************"
114
- value={password}
115
- onChange={(e) => {
116
- setPassword(e.target.value);
117
- formik.setFieldValue("password", e.target.value);
118
- }}
119
- toggleMask
120
- className={classNames("", {
121
- "p-invalid": isFormFieldValid(formik, "password"),
122
- })}
123
- inputClassName="w-full"
124
- feedback={false}
125
- />
126
- {isFormFieldValid(formik, "password") && <Message
127
- className="text-red-500 text-sm"
128
- severity="error"
129
- text={formik?.errors?.password?.toString()}
130
- />}
131
- </div>
132
- {/* <div className="flex align-items-center mt-4">
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
- <div className="mt-4 text-right">
137
- <Link href={"/auth/forgot-password"} className="solid-auth-input-label">Forgot Password?</Link>
138
- </div>
139
- <div className="mt-4">
140
- <Button className="w-full font-light" label="Sign In" />
141
- </div>
142
- </Form>
143
- )}
144
- </Formik>
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="text-center mt-5">
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
- <div className="flex justify-content-center">
50
- <div className="solid-logo flex align-items-center gap-3">
51
- <img
52
- alt="solid logo"
53
- src={'/images/SS-Logo-1 1.png'}
54
- className="position-relative img-fluid"
55
- />
56
- <div>
57
- <p className="solid-logo-title">
58
- Solid<br />Starters
59
- </p>
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
- </div>
63
- <h2 className="solid-auth-title text-center">OTP Verification</h2>
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
- <div className="flex justify-content-center">
117
- <div className="solid-logo flex align-items-center gap-3">
118
- <img
119
- alt="solid logo"
120
- src={'/images/SS-Logo-1 1.png'}
121
- className="position-relative img-fluid"
122
- />
123
- <div>
124
- <p className="solid-logo-title">
125
- Solid<br />Starters
126
- </p>
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
- </div>
130
- <h2 className="solid-auth-title text-center">Sign Up To Your Account</h2>
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">