- Shop Onboarding!
-
Please fill out all the fields.
+
+
+
+
Shop Onboarding!
+
Please fill out all the fields.
+
+
@@ -144,4 +127,4 @@ const Retailer_home = () => {
);
};
-export default Retailer_home;
+export default RetailerHome;
diff --git a/client/src/pages/Signup/Signup.css b/client/src/pages/Signup/Signup.css
new file mode 100644
index 0000000..18f8192
--- /dev/null
+++ b/client/src/pages/Signup/Signup.css
@@ -0,0 +1,57 @@
+
+
+.signup-card {
+ @apply rounded-xl overflow-hidden bg-gradient-to-br from-gray-100 to-gray-200 shadow-lg;
+}
+
+.signup-card .card-header {
+ @apply p-6 bg-gradient-to-r from-blue-500 to-blue-700 text-white rounded-t-xl flex items-center justify-center; /* Center content horizontally and vertically */
+}
+
+.signup-card .card-body {
+ @apply p-8 bg-white rounded-b-xl;
+}
+
+.signup-card .form-control {
+ @apply mb-4 p-3 text-lg border border-gray-300 rounded-lg shadow-sm;
+}
+
+.signup-card .form-control-lg {
+ @apply text-lg;
+}
+
+.signup-card .form-check {
+ @apply mb-4;
+}
+
+.signup-card .form-check-label {
+ @apply text-gray-800 font-semibold;
+}
+
+.signup-card .btn-register {
+ @apply bg-green-600 text-white rounded-lg px-4 py-2 shadow-md hover:bg-green-800;
+}
+
+.signup-card .btn-login {
+ @apply text-white bg-green-600 px-4 py-2 rounded-md shadow-md hover:bg-green-800;
+}
+
+.signup-card .form-group label {
+ @apply text-gray-700 font-bold text-xl mb-2 block;
+}
+
+.signup-card h3 {
+ @apply text-2xl font-bold mb-6;
+}
+
+.signup-card .text-center {
+ @apply mb-0;
+}
+
+.signup-card .text-center p a {
+ @apply text-white bg-green-600 px-4 py-2 rounded-md shadow-md hover:bg-green-800;
+}
+
+.signup-card .btn-register-container {
+ @apply flex justify-center mb-4;
+}
diff --git a/client/src/pages/Signup/signup.jsx b/client/src/pages/Signup/signup.jsx
index cc72470..702f9ba 100644
--- a/client/src/pages/Signup/signup.jsx
+++ b/client/src/pages/Signup/signup.jsx
@@ -1,295 +1,195 @@
import React, { useState } from "react";
-import { Link } from "react-router-dom";
+import { Link, Navigate } from "react-router-dom";
import toast from "react-hot-toast";
import axios from "axios";
-import { Navigate } from "react-router-dom";
+import "./Signup.css";
const Signup = () => {
- const [name, setName] = useState("");
- const [email, setEmail] = useState("");
- const [passwd, setPasswd] = useState("");
- const [ppic, setPpic] = useState("");
- const [street, setStreet] = useState("");
- const [city, setCity] = useState("");
- const [state, setState] = useState("");
- const [pincode, setPincode] = useState(0);
- const [registered, setRegistered] = useState(false);
- const registerf = async (e) => {
- e.preventDefault();
- if (
- !(
- name.length > 0 &&
- email.length > 0 &&
- passwd.length > 0 &&
- street.length > 0 &&
- city.length > 0 &&
- state.length > 0 &&
- pincode > 0
- )
- ) {
- toast.error("All fields are necessary");
- return;
- }
- try {
- const { data } = await axios.post(
- "http://localhost:3000/api/users/signup",
- {
- name,
- email,
- ppic,
- passwd,
- street,
- city,
- state,
- pincode,
- },
- {
- headers: {
- "Content-Type": "application/json",
- },
- withCredentials: true,
- }
- );
- toast(data.message);
- setRegistered(true);
- } catch (error) {
- toast.error(error.response.data.message);
- console.error(error);
+ const [name, setName] = useState("");
+ const [email, setEmail] = useState("");
+ const [passwd, setPasswd] = useState("");
+ const [ppic, setPpic] = useState("");
+ const [street, setStreet] = useState("");
+ const [city, setCity] = useState("");
+ const [state, setState] = useState("");
+ const [pincode, setPincode] = useState("");
+ const [rememberMe, setRememberMe] = useState(false);
+ const [registered, setRegistered] = useState(false);
+
+ const registerf = async (e) => {
+ e.preventDefault();
+ if (
+ !(
+ name.length > 0 &&
+ email.length > 0 &&
+ passwd.length > 0 &&
+ street.length > 0 &&
+ city.length > 0 &&
+ state.length > 0 &&
+ pincode.length > 0
+ )
+ ) {
+ toast.error("All fields are necessary");
+ return;
+ }
+ try {
+ const { data } = await axios.post(
+ "http://localhost:3000/api/users/signup",
+ {
+ name,
+ email,
+ ppic,
+ passwd,
+ street,
+ city,
+ state,
+ pincode,
+ },
+ {
+ headers: {
+ "Content-Type": "application/json",
+ },
+ withCredentials: true,
}
- };
- if (registered) {
- return
;
+ );
+ toast(data.message);
+ setRegistered(true);
+ } catch (error) {
+ toast.error(error.response.data.message);
+ console.error(error);
}
- return (
- <>
-
-
-
-
- REGISTER HERE!!!
-
+ };
-
-
+ return (
+
+
+
+
+
+
Register
+
+
- >
- );
+
+
+
+
+ );
};
export default Signup;
diff --git a/tailwind.config.js b/tailwind.config.js
new file mode 100644
index 0000000..d947ab1
--- /dev/null
+++ b/tailwind.config.js
@@ -0,0 +1,9 @@
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ content: [],
+ theme: {
+ extend: {},
+ },
+ plugins: [],
+}
+