diff --git a/src/App.js b/src/App.js index 399c37b..1f38123 100644 --- a/src/App.js +++ b/src/App.js @@ -9,6 +9,8 @@ import ForgotPassword from "./pages/ForgotPassword"; import Offers from "./pages/Offers"; import Signin from "./pages/Signin"; import Signup from "./pages/Signup"; +import Category from "./pages/Category"; +import CreateLising from "./pages/CreateListing"; function App() { return ( @@ -17,12 +19,15 @@ function App() { } /> } /> + } /> + }> } /> } /> } /> } /> + } /> diff --git a/src/components/ListingItem.jsx b/src/components/ListingItem.jsx new file mode 100644 index 0000000..a806b36 --- /dev/null +++ b/src/components/ListingItem.jsx @@ -0,0 +1,58 @@ +import { Link } from "react-router-dom"; +import { ReactComponent as DeleteIcon } from "../assets/svg/deleteIcon.svg"; +import bedIcon from "../assets/svg/bedIcon.svg"; +import bathtubIcon from "../assets/svg/bathtubIcon.svg"; + +function ListingItem({ listing, id, onDelete }) { + return ( +
  • + + {listing.name} +
    +

    {listing.location}

    +

    {listing.name}

    +

    + $ + {listing.offer + ? listing.discountedPrice + .toString() + .replace(/\B(?=(\d{3})+(?!\d))/g, ",") + : listing.regularPrice + .toString() + .replace(/\B(?=(\d{3})+(?!\d))/g, ",")} + {listing.type === "rent" && " / Month"} +

    +
    + bed +

    + {listing.bedrooms > 1 + ? `${listing.bedrooms} Bedrooms` + : "1 Bedrooms"} +

    + bath +

    + {listing.bathrooms > 1 + ? `${listing.bathrooms} Bedrooms` + : "1 Bathrooms"} +

    +
    +
    + + {onDelete && ( + onDelete(listing.id, listing.name)} + /> + )} +
  • + ); +} +export default ListingItem; diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index 845d79b..3b81eb7 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -16,7 +16,7 @@ function Navbar() {