Skip to content

Commit

Permalink
Merge pull request #123 from Mehtarishita/main
Browse files Browse the repository at this point in the history
login feature redirect done
  • Loading branch information
dhairyagothi authored Oct 7, 2024
2 parents f79a061 + 43fdd49 commit 7176871
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
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.

0 comments on commit 7176871

Please sign in to comment.