diff options
Diffstat (limited to 'panel/src/pages/ManageAds.jsx')
-rw-r--r-- | panel/src/pages/ManageAds.jsx | 80 |
1 files changed, 42 insertions, 38 deletions
diff --git a/panel/src/pages/ManageAds.jsx b/panel/src/pages/ManageAds.jsx index 4ec0b36..70142d2 100644 --- a/panel/src/pages/ManageAds.jsx +++ b/panel/src/pages/ManageAds.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect } from 'react'; import { db } from '../firebase'; import { collection, addDoc, getDocs } from 'firebase/firestore'; +import Navbar from '../components/Navbar'; const ManageAds = () => { const [ads, setAds] = useState([]); @@ -22,46 +23,49 @@ const ManageAds = () => { }; return ( - <div className="container"> - <h4>Manage Ads</h4> - <div className="mb-4"> - <div className="mb-3"> - <label>Title</label> - <input - type="text" - value={newAd.title} - onChange={(e) => setNewAd({ ...newAd, title: e.target.value })} - className="form-control" - /> - </div> - <div className="mb-3"> - <label>Description</label> - <input - type="text" - value={newAd.description} - onChange={(e) => setNewAd({ ...newAd, description: e.target.value })} - className="form-control" - /> + <div> + <Navbar /> + <div className="container mt-5"> + <h4>Manage Ads</h4> + <div className="mb-4"> + <div className="mb-3"> + <label>Title</label> + <input + type="text" + value={newAd.title} + onChange={(e) => setNewAd({ ...newAd, title: e.target.value })} + className="form-control" + /> + </div> + <div className="mb-3"> + <label>Description</label> + <input + type="text" + value={newAd.description} + onChange={(e) => setNewAd({ ...newAd, description: e.target.value })} + className="form-control" + /> + </div> + <div className="mb-3"> + <label>Image URL</label> + <input + type="text" + value={newAd.imageUrl} + onChange={(e) => setNewAd({ ...newAd, imageUrl: e.target.value })} + className="form-control" + /> + </div> + <button onClick={handleAddAd} className="btn btn-primary">Add Ad</button> </div> - <div className="mb-3"> - <label>Image URL</label> - <input - type="text" - value={newAd.imageUrl} - onChange={(e) => setNewAd({ ...newAd, imageUrl: e.target.value })} - className="form-control" - /> + <div> + {ads.map((ad, index) => ( + <div key={index} className="mb-3"> + <h5>{ad.title}</h5> + <p>{ad.description}</p> + <img src={ad.imageUrl} alt={ad.title} className="img-fluid" /> + </div> + ))} </div> - <button onClick={handleAddAd} className="btn btn-primary">Add Ad</button> - </div> - <div> - {ads.map((ad, index) => ( - <div key={index} className="mb-3"> - <h5>{ad.title}</h5> - <p>{ad.description}</p> - <img src={ad.imageUrl} alt={ad.title} className="img-fluid" /> - </div> - ))} </div> </div> ); |