From c3294be9ded434cf156d8aa6b6f98baad7a7ad55 Mon Sep 17 00:00:00 2001 From: Mehtarishita Date: Tue, 8 Oct 2024 00:56:36 +0530 Subject: [PATCH 1/2] redirect page on login n registration --- frontend/src/Pages/LoginPage.jsx | 41 ++++++++++++-------- frontend/src/Pages/Register.jsx | 58 +++++++++++++++++----------- frontend/src/assets/svg/backicon.svg | 3 ++ 3 files changed, 64 insertions(+), 38 deletions(-) create mode 100644 frontend/src/assets/svg/backicon.svg diff --git a/frontend/src/Pages/LoginPage.jsx b/frontend/src/Pages/LoginPage.jsx index ee075c4..eead9e9 100644 --- a/frontend/src/Pages/LoginPage.jsx +++ b/frontend/src/Pages/LoginPage.jsx @@ -1,10 +1,17 @@ import React, { useState } from 'react'; import logo from '../assets/stationsaarthi.svg'; // Import your logo - +import { useNavigate } from 'react-router-dom'; +import backicon from '../assets/svg/backicon.svg'; // Assuming you have a back icon const Login = () => { const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); - + const navigate = useNavigate(); + const RegisterClick = () => { + navigate('/Register'); // Navigates to the login page + } + const HomeClick = () => { + navigate('/'); // Navigates to the home page + } const handleLogin = (e) => { e.preventDefault(); // Handle login logic here @@ -14,44 +21,45 @@ const Login = () => { return (
{/* Logo and Title */} -
- Station Saarthi Logo -

Station Saarthi

-

Your Trusted Platform Guide

+
+
+ Station Saarthi Logo +

Station Saarthi

+

Your Trusted Platform Guide

{/* Login Form */} -
+ {/* Login Heading */} -

+

Login

{/* Username Input */}
- + setUsername(e.target.value)} placeholder="Enter your username" - className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300" + className="w-full px-4 py-2 transition duration-300 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" required />
{/* Password Input */}
- + setPassword(e.target.value)} placeholder="Enter your password" - className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 transition duration-300" + className="w-full px-4 py-2 transition duration-300 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" required />
@@ -59,7 +67,7 @@ const Login = () => { {/* Login Button */} @@ -68,10 +76,11 @@ const Login = () => { {/* Don't have an account link */}

Don't have an account?{' '} - - Register - + +

+
); }; diff --git a/frontend/src/Pages/Register.jsx b/frontend/src/Pages/Register.jsx index eceb0b1..d1f19c6 100644 --- a/frontend/src/Pages/Register.jsx +++ b/frontend/src/Pages/Register.jsx @@ -1,7 +1,17 @@ import React, { useState } from 'react'; import logo from '../assets/stationsaarthi.svg'; // Ensure the path is correct - +import { useNavigate } from 'react-router-dom'; +import backicon from '../assets/svg/backicon.svg'; const Register = () => { + + const navigate = useNavigate(); + const LoginClick = () => { + navigate('/Login'); // Navigates to the login page + }; + const HomeClick = () => { + navigate('/'); // Navigates to the home page + }; + const [name, setName] = useState(''); const [phoneNumber, setPhoneNumber] = useState(''); const [email, setEmail] = useState(''); @@ -13,31 +23,34 @@ const Register = () => { }; return ( -
+ <> + +
{/* Logo and Title */} -
- Station Saarthi Logo +
+
+ Station Saarthi Logo

Station Saarthi

-

Your Trusted Platform Guide

+

Your Trusted Platform Guide

{/* Registration Form */} - + {/* Register Heading */} -

+

Register

{/* Name Input */}
- + setName(e.target.value)} placeholder="Enter your name" - className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm" + className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" required />
@@ -45,7 +58,7 @@ const Register = () => { {/* Phone Number Input */}
+ ); }; -export default Register; +export default Register; \ No newline at end of file diff --git a/frontend/src/assets/svg/backicon.svg b/frontend/src/assets/svg/backicon.svg new file mode 100644 index 0000000..6b7667e --- /dev/null +++ b/frontend/src/assets/svg/backicon.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file From 43fdd49e2d9e3b6959f511556679a4c0cfb6882d Mon Sep 17 00:00:00 2001 From: Mehtarishita Date: Tue, 8 Oct 2024 01:16:52 +0530 Subject: [PATCH 2/2] redirect login done --- frontend/src/Pages/LoginPage.jsx | 10 ---------- frontend/src/Pages/Register.jsx | 12 ------------ 2 files changed, 22 deletions(-) diff --git a/frontend/src/Pages/LoginPage.jsx b/frontend/src/Pages/LoginPage.jsx index dce60e3..eead9e9 100644 --- a/frontend/src/Pages/LoginPage.jsx +++ b/frontend/src/Pages/LoginPage.jsx @@ -1,11 +1,7 @@ import React, { useState } from 'react'; import logo from '../assets/stationsaarthi.svg'; // Import your logo import { useNavigate } from 'react-router-dom'; -<<<<<<< HEAD import backicon from '../assets/svg/backicon.svg'; // Assuming you have a back icon -======= - ->>>>>>> f79a0616cca434699eaa1820cb1a5370eac5632f const Login = () => { const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); @@ -13,12 +9,9 @@ const Login = () => { const RegisterClick = () => { navigate('/Register'); // Navigates to the login page } -<<<<<<< HEAD const HomeClick = () => { navigate('/'); // Navigates to the home page } -======= ->>>>>>> f79a0616cca434699eaa1820cb1a5370eac5632f const handleLogin = (e) => { e.preventDefault(); // Handle login logic here @@ -28,10 +21,7 @@ const Login = () => { return (
{/* Logo and Title */} -<<<<<<< HEAD
-======= ->>>>>>> f79a0616cca434699eaa1820cb1a5370eac5632f
Station Saarthi Logo

Station Saarthi

diff --git a/frontend/src/Pages/Register.jsx b/frontend/src/Pages/Register.jsx index 661b70f..d1f19c6 100644 --- a/frontend/src/Pages/Register.jsx +++ b/frontend/src/Pages/Register.jsx @@ -1,23 +1,16 @@ import React, { useState } from 'react'; import logo from '../assets/stationsaarthi.svg'; // Ensure the path is correct import { useNavigate } from 'react-router-dom'; -<<<<<<< HEAD import backicon from '../assets/svg/backicon.svg'; -======= - ->>>>>>> f79a0616cca434699eaa1820cb1a5370eac5632f const Register = () => { const navigate = useNavigate(); const LoginClick = () => { navigate('/Login'); // Navigates to the login page }; -<<<<<<< HEAD const HomeClick = () => { navigate('/'); // Navigates to the home page }; -======= ->>>>>>> f79a0616cca434699eaa1820cb1a5370eac5632f const [name, setName] = useState(''); const [phoneNumber, setPhoneNumber] = useState(''); @@ -30,16 +23,11 @@ const Register = () => { }; return ( -<<<<<<< HEAD <>
{/* Logo and Title */}
-======= -
- {/* Logo and Title */} ->>>>>>> f79a0616cca434699eaa1820cb1a5370eac5632f
Station Saarthi Logo

Station Saarthi