aboutsummaryrefslogtreecommitdiffstats
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/AdCard.jsx13
-rw-r--r--src/components/AdForm.jsx40
-rw-r--r--src/components/Navbar.jsx14
3 files changed, 67 insertions, 0 deletions
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 (
+ <div>
+ <h2>{ad.title}</h2>
+ <p>{ad.description}</p>
+ <img src={ad.image} alt={ad.title} />
+ </div>
+ );
+};
+
+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 (
+ <form onSubmit={handleSubmit}>
+ <input
+ type="text"
+ placeholder="Title"
+ value={title}
+ onChange={(e) => setTitle(e.target.value)}
+ />
+ <textarea
+ placeholder="Description"
+ value={description}
+ onChange={(e) => setDescription(e.target.value)}
+ />
+ <input
+ type="text"
+ placeholder="Image URL"
+ value={image}
+ onChange={(e) => setImage(e.target.value)}
+ />
+ <button type="submit">Add Ad</button>
+ </form>
+ );
+};
+
+export default AdForm;
diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx
new file mode 100644
index 0000000..9862d29
--- /dev/null
+++ b/src/components/Navbar.jsx
@@ -0,0 +1,14 @@
+import React from 'react';
+import { Link } from 'react-router-dom';
+
+const Navbar = () => {
+ return (
+ <nav>
+ <Link to="/dashboard">Dashboard</Link>
+ <Link to="/manage-ads">Manage Ads</Link>
+ <Link to="/logout">Logout</Link>
+ </nav>
+ );
+};
+
+export default Navbar;