diff --git a/frontend/src/components/Settings.jsx b/frontend/src/components/Settings.jsx index 8a9232f..ee83595 100644 --- a/frontend/src/components/Settings.jsx +++ b/frontend/src/components/Settings.jsx @@ -1,24 +1,252 @@ -import React from 'react'; -import { useNavigate } from 'react-router-dom'; -import backicon from '../assets/svg/backicon.svg'; -const Settings = () => { +// SettingsPage.jsx +import React, { useState } from "react"; +import { useNavigate } from "react-router-dom"; +import backicon from './path_to_back_icon_image'; // Ensure you have this image + +const SettingsPage = () => { const navigate = useNavigate(); + // State for form inputs + const [profileDetails, setProfileDetails] = useState({ + name: "John Doe", + email: "johndoe@example.com", + phoneNumber: "+1234567890", + address: "123 Station Road, Yarthi City", + password: "", + confirmPassword: "", + }); + + const [generalSettings, setGeneralSettings] = useState({ + language: "English", + theme: "Light", + }); + + const [notifications, setNotifications] = useState({ + emailAlerts: true, + smsAlerts: false, + trainUpdates: true, + }); + + const [privacySettings, setPrivacySettings] = useState({ + locationTracking: true, + profileVisibility: "Public", + }); + + // Handlers for input changes + const handleProfileChange = (e) => { + const { name, value } = e.target; + setProfileDetails({ ...profileDetails, [name]: value }); + }; + + const handleGeneralChange = (e) => { + const { name, value } = e.target; + setGeneralSettings({ ...generalSettings, [name]: value }); + }; + + const handleNotificationChange = (e) => { + const { name, checked } = e.target; + setNotifications({ ...notifications, [name]: checked }); + }; + + const handlePrivacyChange = (e) => { + const { name, value } = e.target; + setPrivacySettings({ ...privacySettings, [name]: value }); + }; + + // Navigate back to home page + const goToHome = () => { + navigate("/"); + }; -const HomeClick = () => { - navigate('/'); // Navigates to the home page - }; return ( <> - + +
+
+

Station Yarthi Settings

+ + {/* Profile Details */} +
+

Profile Details

+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ + {/* General Settings */} +
+

General Settings

+
+
+ + +
+ +
+ + +
+
+
+ + {/* Notifications */} +
+

Notification Settings

+
+
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ + {/* Privacy Settings */} +
+

Privacy Settings

+
+
+ + +
+
+
+ + {/* Save and Back to Home Button */} +
+ + -
-

Settings Page

- -
+
+
+
); }; -export default Settings; \ No newline at end of file +export default SettingsPage;