Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login feature redirect done #123

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion frontend/src/Pages/LoginPage.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +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
Expand All @@ -18,6 +21,7 @@ const Login = () => {
return (
<div className="flex flex-col items-center justify-center min-h-screen bg-gradient-to-b from-blue-100 to-blue-5000">
{/* Logo and Title */}
<div ><button onClick={HomeClick}><img src={backicon} alt="" srcset="" className='fixed left-[1vh] h-[9vh] w-auto' /></button></div>
<div className="mb-10 text-center ">
<img src={logo} alt="Station Saarthi Logo" className="w-20 mx-auto h-22 " />
<h1 className="mt-4 text-4xl font-bold text-gray-800 ">Station Saarthi</h1>
Expand Down
9 changes: 8 additions & 1 deletion frontend/src/Pages/Register.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
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('');
Expand All @@ -20,8 +23,11 @@ const Register = () => {
};

return (
<>

<div className="flex flex-col items-center justify-center min-h-screen px-4 bg-gradient-to-b from-blue-100 to-blue-5000">
{/* Logo and Title */}
<div ><button onClick={HomeClick}><img src={backicon} alt="" srcset="" className='fixed left-[1vh] h-[9vh] w-auto' /></button></div>
<div className="mb-6 text-center">
<img src={logo} alt="Station Saarthi Logo" className="w-20 mx-auto mb-2 h-22" />
<h1 className="text-2xl font-bold text-gray-800">Station Saarthi</h1>
Expand Down Expand Up @@ -120,6 +126,7 @@ const Register = () => {
className="text-blue-500 underline cursor-pointer"> Login</button>
</p>
</div>
</>
);
};

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/assets/svg/backicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading