From 680f38b1c48c4cc5c4b34b285f68fe48217d0ab9 Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Thu, 25 Jul 2024 22:54:55 +0530 Subject: setting up login --- src/pages/Dashboard.jsx | 14 ++++++++++++++ src/pages/Login.jsx | 24 ++++++++++++++++++++++++ src/pages/ManageAds.jsx | 35 +++++++++++++++++++++++++++++++++++ src/pages/Register.jsx | 21 +++++++++++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 src/pages/Dashboard.jsx create mode 100644 src/pages/Login.jsx create mode 100644 src/pages/ManageAds.jsx create mode 100644 src/pages/Register.jsx (limited to 'src/pages') diff --git a/src/pages/Dashboard.jsx b/src/pages/Dashboard.jsx new file mode 100644 index 0000000..ce3472e --- /dev/null +++ b/src/pages/Dashboard.jsx @@ -0,0 +1,14 @@ +import React from 'react'; +import Navbar from '../components/Navbar'; + +const Dashboard = () => { + return ( +
+ +

Dashboard

+ {/* Add dashboard content here */} +
+ ); +}; + +export default Dashboard; diff --git a/src/pages/Login.jsx b/src/pages/Login.jsx new file mode 100644 index 0000000..89e0c8b --- /dev/null +++ b/src/pages/Login.jsx @@ -0,0 +1,24 @@ +import React from 'react'; +import { useNavigate } from 'react-router-dom'; + +const Login = () => { + const navigate = useNavigate(); + + const handleLogin = () => { + // Handle login logic here + navigate('/dashboard'); + }; + + return ( +
+

Login

+
+ + + +
+
+ ); +}; + +export default Login; diff --git a/src/pages/ManageAds.jsx b/src/pages/ManageAds.jsx new file mode 100644 index 0000000..834a898 --- /dev/null +++ b/src/pages/ManageAds.jsx @@ -0,0 +1,35 @@ +import React, { useState, useEffect } from 'react'; +import AdCard from '../components/AdCard'; +import AdForm from '../components/AdForm'; +import { fetchAds, addAd } from '../utils/api'; + +const ManageAds = () => { + const [ads, setAds] = useState([]); + + useEffect(() => { + const getAds = async () => { + const adsData = await fetchAds(); + setAds(adsData); + }; + getAds(); + }, []); + + const handleAddAd = async (ad) => { + await addAd(ad); + setAds([...ads, ad]); + }; + + return ( +
+

Manage Ads

+ +
+ {ads.map((ad) => ( + + ))} +
+
+ ); +}; + +export default ManageAds; diff --git a/src/pages/Register.jsx b/src/pages/Register.jsx new file mode 100644 index 0000000..84c0bf2 --- /dev/null +++ b/src/pages/Register.jsx @@ -0,0 +1,21 @@ +import React from 'react'; + +const Register = () => { + const handleRegister = (e) => { + e.preventDefault(); + // Handle registration logic here + }; + + return ( +
+

Register

+
+ + + +
+
+ ); +}; + +export default Register; -- cgit v1.2.3-59-g8ed1b