From f40362c80d6196dd1450ff12618dd691e16b7d5f Mon Sep 17 00:00:00 2001 From: angelp03 Date: Thu, 7 Nov 2024 18:47:35 -0600 Subject: [PATCH] Add ReviewList and Filtering --- src/components/Banner.jsx | 4 ++ src/components/CafeList.css | 28 +++++++++++++ src/components/CafeList.jsx | 78 +++++++++++++++++++++++++++++++++++++ src/pages/ReviewsPage.jsx | 13 +++++++ 4 files changed, 123 insertions(+) create mode 100644 src/components/CafeList.css create mode 100644 src/components/CafeList.jsx create mode 100644 src/pages/ReviewsPage.jsx diff --git a/src/components/Banner.jsx b/src/components/Banner.jsx index b13b9ad..2642603 100644 --- a/src/components/Banner.jsx +++ b/src/components/Banner.jsx @@ -3,6 +3,10 @@ import Icon from '../Icon.svg'; import Search from '../Search.svg'; const Banner = () => { + // const navigate = useNavigate(); + // const navigateToReviews = () => { + // navigate('/reviews') + // } return (
diff --git a/src/components/CafeList.css b/src/components/CafeList.css new file mode 100644 index 0000000..18ba163 --- /dev/null +++ b/src/components/CafeList.css @@ -0,0 +1,28 @@ +.cafe-list-container { + display: flex; + gap: 2rem; +} + +.filter { + width: 250px; + padding: 1rem; + background-color: #f5f5f5; + border-radius: 5px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); +} + +.cafe-list { + display: block; + flex-grow: 1; +} + +.cafe-card { + width: 100%; + margin-bottom: 1rem; + padding: 1rem; + border: 1px solid #ccc; + border-radius: 5px; + background-color: #fff; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} + diff --git a/src/components/CafeList.jsx b/src/components/CafeList.jsx new file mode 100644 index 0000000..e29411c --- /dev/null +++ b/src/components/CafeList.jsx @@ -0,0 +1,78 @@ +import './CafeList.css'; + +const reviews = [ + { + id: 1, + author: 'John Doe', + rating: 4, + content: 'Currently busy.', + location: 'Starbucks', + }, + { + id: 2, + author: 'Jane Smith', + rating: 5, + content: 'Somewhat busy, some seats remain.', + location: 'Colectivo', + }, + { + id: 3, + author: 'Alice Johnson', + rating: 3, + content: 'Very empty, plenty of seats.', + location: "Phil's", + }, + { + id: 4, + author: 'Bob Brown', + rating: 5, + content: 'Very quiet and great coffee!', + location: 'Coffee Lab', + }, +]; + +const CafeList = () => { + return ( +
+ {/* Filter section */} +
+

Filter Options

+ {/* Example filter options */} + +
+ + {/* Add more filters here as needed */} +
+ + {/* Review cards */} +
+ {reviews.map((review) => ( +
+

{review.author}

+

{review.location}

+
+ {Array.from({ length: review.rating }).map((_, index) => ( + + ))} +
+

{review.content}

+
+ ))} +
+
+ ); +} + +export default CafeList; diff --git a/src/pages/ReviewsPage.jsx b/src/pages/ReviewsPage.jsx new file mode 100644 index 0000000..c79993c --- /dev/null +++ b/src/pages/ReviewsPage.jsx @@ -0,0 +1,13 @@ +import Banner from "../components/Banner"; +import CafeList from "../components/CafeList"; + +const ReviewsPage = () => { + return ( +
+ + +
+ ) +} + +export default ReviewsPage; \ No newline at end of file