diff --git a/frontend/src/Pages/Register.jsx b/frontend/src/Pages/Register.jsx index d1f19c6..c22ca2c 100644 --- a/frontend/src/Pages/Register.jsx +++ b/frontend/src/Pages/Register.jsx @@ -19,7 +19,7 @@ const Register = () => { const handleRegister = (e) => { e.preventDefault(); - // Handle registration logic here + // Handle registration logic here }; return ( diff --git a/frontend/src/Pages/stations.jsx b/frontend/src/Pages/stations.jsx index dabd7cc..7536fbb 100644 --- a/frontend/src/Pages/stations.jsx +++ b/frontend/src/Pages/stations.jsx @@ -1,13 +1,14 @@ // src/components/RailwayStations.jsx -import React, { useState } from 'react'; -import { FaTrain } from 'react-icons/fa'; // Using FontAwesome train icon -import { AiFillStar, AiOutlineStar } from 'react-icons/ai'; // Star icons for favorites - +import React, { useState } from "react"; +import { FaTrain } from "react-icons/fa"; // Using FontAwesome train icon +import { AiFillStar, AiOutlineStar } from "react-icons/ai"; // Star icons for favorites +import backicon from "../assets/svg/backicon.svg"; +import { useNavigate } from "react-router-dom"; const RailwayStations = () => { - // Comprehensive list of railway stations - const stations = [ - // A + // Comprehensive list of railway stations + const stations = [ + // A "Agartala Railway Station", "Agra Cantonment", "Ahmedabad Junction", @@ -155,103 +156,131 @@ const RailwayStations = () => { // Z "Ziyadpur Junction", - // Add more stations as needed - ]; - - const [searchTerm, setSearchTerm] = useState(''); - const [favorites, setFavorites] = useState([]); + // Add more stations as needed + ]; - // Function to toggle favorite stations - const toggleFavorite = (station) => { - if (favorites.includes(station)) { - setFavorites(favorites.filter((fav) => fav !== station)); - } else { - setFavorites([...favorites, station]); - } - }; + const [searchTerm, setSearchTerm] = useState(""); + const [favorites, setFavorites] = useState([]); + const navigate = useNavigate(); + + // Function to toggle favorite stations + const toggleFavorite = (station) => { + if (favorites.includes(station)) { + setFavorites(favorites.filter((fav) => fav !== station)); + } else { + setFavorites([...favorites, station]); + } + }; + const HomeClick = () => { + navigate("/"); // Navigates to the home page + }; - // Filter stations based on search term - const filteredStations = stations.filter((station) => - station.toLowerCase().includes(searchTerm.toLowerCase()) - ); + // Filter stations based on search term + const filteredStations = stations.filter((station) => + station.toLowerCase().includes(searchTerm.toLowerCase()) + ); - return ( -
Find and explore railway stations across India
-+ Find and explore railway stations across India +
+