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/components/AdCard.jsx | 13 +++++++++++++ src/components/AdForm.jsx | 40 ++++++++++++++++++++++++++++++++++++++++ src/components/Navbar.jsx | 14 ++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 src/components/AdCard.jsx create mode 100644 src/components/AdForm.jsx create mode 100644 src/components/Navbar.jsx (limited to 'src/components') diff --git a/src/components/AdCard.jsx b/src/components/AdCard.jsx new file mode 100644 index 0000000..6e854ed --- /dev/null +++ b/src/components/AdCard.jsx @@ -0,0 +1,13 @@ +import React from 'react'; + +const AdCard = ({ ad }) => { + return ( +
+

{ad.title}

+

{ad.description}

+ {ad.title} +
+ ); +}; + +export default AdCard; diff --git a/src/components/AdForm.jsx b/src/components/AdForm.jsx new file mode 100644 index 0000000..3274803 --- /dev/null +++ b/src/components/AdForm.jsx @@ -0,0 +1,40 @@ +import React, { useState } from 'react'; + +const AdForm = ({ onAddAd }) => { + const [title, setTitle] = useState(''); + const [description, setDescription] = useState(''); + const [image, setImage] = useState(''); + + const handleSubmit = (e) => { + e.preventDefault(); + onAddAd({ title, description, image }); + setTitle(''); + setDescription(''); + setImage(''); + }; + + return ( +
+ setTitle(e.target.value)} + /> +