Skip to content

Commit bc2e604

Browse files
committed
updates
1 parent 01f50c8 commit bc2e604

8 files changed

Lines changed: 568 additions & 98 deletions

File tree

src/components/ListCard.jsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function ListCard({ title, creator, restaurantCount, onClick }) {
1212
return (
1313
<Card
1414
className="shadow-sm mb-3 h-100"
15-
style={{ cursor: "pointer", transition: "transform 0.2s" }}
15+
style={{ cursor: "pointer", transition: "transform 0.2s", color: "black" }}
1616
onClick={onClick}
1717
onKeyPress={handleKeyPress}
1818
tabIndex={0}
@@ -26,9 +26,19 @@ export default function ListCard({ title, creator, restaurantCount, onClick }) {
2626
<Card.Text className="text-muted mb-2">
2727
Created by <strong>{creator}</strong>
2828
</Card.Text>
29-
<Badge bg="info" className="mt-1">
30-
{restaurantCount} restaurants
29+
30+
<Badge
31+
bg="none"
32+
className="mt-1"
33+
style={{
34+
fontSize: "0.875rem",
35+
backgroundColor: "#E34234",
36+
color: "white"
37+
}}
38+
>
39+
{restaurantCount} {restaurantCount === 1 ? 'restaurant' : 'restaurants'}
3140
</Badge>
41+
3242
</Card.Body>
3343
</Card>
3444
);

src/components/NavigationBar.jsx

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,37 @@ export default function NavigationBar() {
4545
<Nav className="me-auto ms-4">
4646
<Nav.Link
4747
onClick={() => navigate("/")}
48-
style={{ color: "white", fontSize: "18px", marginRight: "1rem" }}
48+
style={{
49+
color: "#000000",
50+
fontSize: "18px",
51+
marginRight: "1rem",
52+
fontWeight: "600",
53+
textShadow: "none"
54+
}}
4955
>
5056
Home
5157
</Nav.Link>
5258
<Nav.Link
5359
onClick={() => navigate("/about")}
54-
style={{ color: "white", fontSize: "18px", marginRight: "1rem" }}
60+
style={{
61+
color: "#000000",
62+
fontSize: "18px",
63+
marginRight: "1rem",
64+
fontWeight: "600",
65+
textShadow: "none"
66+
}}
5567
>
5668
About
5769
</Nav.Link>
5870
<Nav.Link
5971
onClick={() => navigate("/friends")}
60-
style={{ color: "white", fontSize: "18px", marginRight: "1rem" }}
72+
style={{
73+
color: "#000000",
74+
fontSize: "18px",
75+
marginRight: "1rem",
76+
fontWeight: "600",
77+
textShadow: "none"
78+
}}
6179
>
6280
Friends
6381
</Nav.Link>
@@ -69,7 +87,7 @@ export default function NavigationBar() {
6987
<>
7088
<Nav.Link
7189
onClick={() => navigate("/profile")}
72-
style={{ color: "white", fontSize: "18px", marginRight: "1rem" }}
90+
style={{ color: "black", fontSize: "18px", marginRight: "1rem" }}
7391
>
7492
Profile
7593
</Nav.Link>
@@ -85,7 +103,7 @@ export default function NavigationBar() {
85103
) : (
86104
<Nav.Link
87105
onClick={() => navigate("/login")}
88-
style={{ color: "white", fontSize: "18px", marginRight: "1rem" }}
106+
style={{ color: "black", fontSize: "18px", marginRight: "1rem" }}
89107
>
90108
Login/Signup
91109
</Nav.Link>

src/components/ResturantDetailPanel.jsx

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { Card, Image } from "react-bootstrap";
2+
import { Card, Image, Button } from "react-bootstrap";
33
import Tag from "./Tag";
44

55
const FALLBACK_IMAGE = "https://images.unsplash.com/photo-1447933601403-0c6688de566e?auto=format&fit=crop&w=1500&q=80";
@@ -13,7 +13,7 @@ const normalizeTags = (tags) => {
1313
};
1414

1515
export default function RestaurantDetailPanel({ restaurant, onTagClick }) {
16-
const { name, rating, tags = [], address, hours, description, image, imageAlt, image_alt } = restaurant;
16+
const { name, rating, tags = [], address, hours, description, image, imageAlt, image_alt, website, maps_link } = restaurant;
1717
const altText = imageAlt || image_alt;
1818
const normalizedTags = normalizeTags(tags);
1919
const imageSrc = image || FALLBACK_IMAGE;
@@ -63,6 +63,35 @@ export default function RestaurantDetailPanel({ restaurant, onTagClick }) {
6363
</Card.Text>
6464
)}
6565

66+
{(website || maps_link) && (
67+
<div className="mb-3 d-flex gap-2 flex-wrap">
68+
{website && (
69+
<Button
70+
variant="outline-primary"
71+
size="sm"
72+
href={website}
73+
target="_blank"
74+
rel="noopener noreferrer"
75+
aria-label={`Visit ${name} website`}
76+
>
77+
🌐 Website
78+
</Button>
79+
)}
80+
{maps_link && (
81+
<Button
82+
variant="outline-success"
83+
size="sm"
84+
href={maps_link}
85+
target="_blank"
86+
rel="noopener noreferrer"
87+
aria-label={`View ${name} on Google Maps`}
88+
>
89+
📍 View on Maps
90+
</Button>
91+
)}
92+
</div>
93+
)}
94+
6695
{description && (
6796
<>
6897
<h2 className="h5 mt-4">About</h2>

src/hooks/useLists.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ export const useLists = () => {
1818

1919
const listRows = data || [];
2020
const listIds = listRows.map((l) => l.id).filter(Boolean);
21+
const creatorIds = [...new Set(listRows.map((l) => l.creator_id).filter(Boolean))];
22+
2123
let counts = {};
24+
let profiles = {};
2225

26+
// Fetch restaurant counts
2327
if (listIds.length) {
2428
const { data: restaurantRows, error: restaurantError } = await supabase
2529
.from('restaurants')
@@ -34,9 +38,25 @@ export const useLists = () => {
3438
}
3539
}
3640

41+
// Fetch usernames from profiles
42+
if (creatorIds.length) {
43+
const { data: profileRows, error: profileError } = await supabase
44+
.from('profiles')
45+
.select('id, username')
46+
.in('id', creatorIds);
47+
48+
if (!profileError && profileRows) {
49+
profiles = profileRows.reduce((acc, profile) => {
50+
acc[profile.id] = profile.username;
51+
return acc;
52+
}, {});
53+
}
54+
}
55+
3756
const hydratedLists = listRows.map((list) => ({
3857
...list,
3958
restaurant_count: counts[list.id] || 0,
59+
creator_name: profiles[list.creator_id] || list.creator_name || 'Anonymous',
4060
}));
4161

4262
setLists(hydratedLists);

0 commit comments

Comments
 (0)