Skip to content

Commit 7691329

Browse files
committed
2 parents 60ba0ec + 7b7e47d commit 7691329

File tree

6 files changed

+10
-52
lines changed

6 files changed

+10
-52
lines changed

app/bar/[id]/UserGridClient.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ export default function UserGridClient({ bar }: UserGridClientProps) {
124124
{/* Cover Image Section */}
125125
<div className="absolute w-full h-[220px] left-0 top-0">
126126
<Image
127-
src="/images/cover/1.png"
128-
alt="Bar Cover"
127+
src={bar.image || "/images/cover/1.png"}
128+
alt={bar.name}
129129
fill
130130
className="object-cover w-full h-full"
131131
priority
@@ -219,9 +219,6 @@ export default function UserGridClient({ bar }: UserGridClientProps) {
219219
<div className="font-semibold text-sm leading-tight truncate">
220220
{user.username}
221221
</div>
222-
<div className="text-xs text-muted-foreground mb-1 truncate">
223-
{user.bio || "มหาสนั่นท์"}
224-
</div>
225222
<div className="flex flex-wrap gap-1 mt-1">
226223
{user.preferences?.favoriteCategories?.slice(0, 3).map((cat) => (
227224
<Badge

components/bars/bar-list.tsx

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
11
"use client";
22

3-
import { MOCK_BARS, MOCK_USERS } from "@/lib/constants";
3+
import { Bar, MOCK_BARS, MOCK_USERS } from "@/lib/constants";
44
import { cn } from "@/lib/utils";
55
import { ExternalLink, Music, Navigation, User, Wine, MapPin } from "lucide-react";
66
import Image from "next/image";
77
import { useRouter } from "next/navigation";
88
import { useMemo, useState, useEffect } from "react";
99

10-
interface Bar {
11-
id: string;
12-
name: string;
13-
location: string;
14-
genre: string;
15-
todaysBand: string;
16-
isOpen: boolean;
17-
coordinates?: {
18-
lat: number;
19-
lng: number;
20-
};
21-
distance?: string;
22-
}
10+
2311

2412
export function BarList() {
2513
const router = useRouter();
@@ -82,13 +70,6 @@ export function BarList() {
8270
window.open(mapsUrl, '_blank');
8371
};
8472

85-
// Generate placeholder image for each bar
86-
const getBarImage = (barId: string) => {
87-
const imageIds = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
88-
const seed = parseInt(barId) || 1;
89-
const imageId = imageIds[seed % imageIds.length];
90-
return `https://picsum.photos/seed/bar${imageId}/400/240`;
91-
};
9273

9374
return (
9475
<div className="flex flex-col items-center justify-center w-full px-4 py-8 bg-gradient-to-b from-background to-muted/20">
@@ -173,7 +154,7 @@ export function BarList() {
173154
<div className="relative w-32 flex-shrink-0">
174155
<Image
175156
priority
176-
src={getBarImage(bar.id)}
157+
src={bar.image}
177158
alt={bar.name}
178159
fill
179160
className="object-cover transition-transform duration-300 group-hover:scale-105"

lib/constants.ts

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export interface Bar {
2-
activeUsers: number;
32
id: string;
43
name: string;
54
description: string;
@@ -25,27 +24,10 @@ export interface Bar {
2524

2625
export const MOCK_BARS: Bar[] = [
2726
{
28-
activeUsers: 0,
2927
id: "1",
30-
name: "ร้าน(อ)โคจร",
31-
description: "บาร์ดนตรีสดใกล้ ม.กรุงเทพ รังสิต บรรยากาศสนุก ดนตรีมันส์ ราคาเข้าถึงง่าย",
32-
image: "/images/bar/1",
33-
rating: 4.3,
34-
location: "95/1 ซอยไอยราแกรนด์ คลองหนึ่ง คลองหลวง ปทุมธานี",
35-
category: "pub",
36-
features: ["Live Music", "Budget Friendly", "Student Crowd"],
37-
genre: "อินดี้ป็อป",
38-
distance: "0.3 กม.",
39-
todaysBand: "วง The Young Blues",
40-
isOpen: true,
41-
coordinates: { lat: 14.046505, lng: 100.595893 }
42-
},
43-
{
44-
activeUsers: 0,
45-
id: "2",
4628
name: "LIV Club Bangkok",
4729
description: "ผับเปิดใหม่ล่าสุดของย่านเอกมัย พร้อมกับระบบแสงสีเสียงสุดทันสมัย จัดเต็มจอ LED ขนาดยักษ์-เลเซอร์แน่นร้าน พร้อมกับโชว์และไลน์อัพดีเจสุดพิเศษมากมาย ที่พร้อมเสิร์ฟเพลง EDM ตลอดทั้งคืน !!",
48-
image: "/images/bar/2",
30+
image: "/images/cover/2.png",
4931
rating: 4.5,
5032
location: "เอกมัย, กรุงเทพฯ",
5133
category: "club",
@@ -56,11 +38,10 @@ export const MOCK_BARS: Bar[] = [
5638
coordinates: { lat: 13.733, lng: 100.588 }
5739
},
5840
{
59-
activeUsers: 0,
60-
id: "3",
41+
id: "2",
6142
name: "MUIN Club",
6243
description: "MUIN คลับดังจากเกาหลี เปิดสาขาใหม่ที่ทองหล่อ–เอกมัย พร้อมแสงสีเสียงสุดอลังการให้ฟีลเหมือนอยู่ในเฟสติวัล ตั้งอยู่บนชั้น 5 ของ Donki Mall ร้านกว้าง เพดานสูง มีหลายโซนหลายแนวเพลงให้เลือกตามสไตล์คุณ",
63-
image: "/images/bar/3",
44+
image: "/images/cover/3.png",
6445
rating: 4.6,
6546
location: "ชั้น 5 Donki Mall, ทองหล่อ–เอกมัย, กรุงเทพฯ",
6647
category: "club",
@@ -71,11 +52,10 @@ export const MOCK_BARS: Bar[] = [
7152
coordinates: { lat: 13.735, lng: 100.586 }
7253
},
7354
{
74-
activeUsers: 0,
75-
id: "4",
55+
id: "3",
7656
name: "Bamboo Bar",
7757
description: "บาร์แจ๊สที่เก่าแก่ที่สุดในประเทศไทย และเป็นหนึ่งในบาร์ของไทยที่ติดอันดับ Asia’s 50 Best Bars ด้วยดนตรีแจ๊สคุณภาพและเอกลักษณ์เฉพาะตัว ผสานบรรยากาศคลาสสิกเข้ากับเครื่องดื่มหลากหลาย ทำให้ที่นี่เป็นจุดหมายยอดนิยมของคนรักแจ๊สมาอย่างยาวนาน",
78-
image: "/images/bar/4",
58+
image: "/images/cover/4.png",
7959
rating: 4.8,
8060
location: "โรงแรมแมนดาริน โอเรียนเต็ล กรุงเทพฯ",
8161
category: "bar",

public/images/cover/2.png

3.25 MB
Loading

public/images/cover/3.png

2.02 MB
Loading

public/images/cover/4.png

9.85 MB
Loading

0 commit comments

Comments
 (0)