Skip to content

Commit 779f5cf

Browse files
author
jean-philippe
committed
wip
1 parent a3cdf96 commit 779f5cf

4 files changed

Lines changed: 34 additions & 177 deletions

File tree

src/components/profile/EmptyState.tsx

Lines changed: 0 additions & 103 deletions
This file was deleted.

src/components/profile/TabsSection.tsx

Lines changed: 31 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
import { component$, useSignal } from "@builder.io/qwik";
2-
import {
3-
CalendarIcon as Calendar,
4-
UserPlusIcon as UserPlus,
5-
HeartIcon as Heart,
6-
} from "lucide-qwik";
2+
73
import type { DetailedEventType, PlaceType } from "~/routes/profile/types";
84
import { EventCard } from "./EventCard";
95
import { PlaceCard } from "./PlaceCard";
10-
import { EmptyState } from "./EmptyState";
116

127
interface TabsSectionProps {
138
upcomingEvents: DetailedEventType[];
@@ -46,28 +41,24 @@ export const TabsSection = component$<TabsSectionProps>(
4641
const tabs: {
4742
id: string;
4843
label: string;
49-
icon: any;
5044
count: number;
5145
}[] = [
52-
{
53-
id: "upcoming",
54-
label: "Upcoming",
55-
icon: Calendar,
56-
count: upcomingEvents.length,
57-
},
58-
{
59-
id: "hosted",
60-
label: "Hosted",
61-
icon: UserPlus,
62-
count: hostedEvents.length,
63-
},
64-
{
65-
id: "saved",
66-
label: "Saved Places",
67-
icon: Heart,
68-
count: savedPlaces.length,
69-
},
70-
];
46+
{
47+
id: "upcoming",
48+
label: "Upcoming",
49+
count: upcomingEvents.length,
50+
},
51+
{
52+
id: "hosted",
53+
label: "Hosted",
54+
count: hostedEvents.length,
55+
},
56+
{
57+
id: "saved",
58+
label: "Saved Places",
59+
count: savedPlaces.length,
60+
},
61+
];
7162

7263
return (
7364
<div class="w-full">
@@ -80,37 +71,29 @@ export const TabsSection = component$<TabsSectionProps>(
8071
// Capture serializable values and component reference outside the JSX scope
8172
// to avoid potential serialization issues with the entire 'tab' object in onClick$.
8273
const tabId = tab.id;
83-
const TabIcon = tab.icon;
8474
const tabLabel = tab.label;
8575
const tabCount = tab.count;
8676

8777
return (
8878
<button
8979
key={tabId}
9080
onClick$={() => (activeTab.value = tabId)} // Use captured primitive value
91-
class={`group inline-flex shrink-0 items-center whitespace-nowrap border-b-2 px-1 py-4 text-base font-medium transition-colors duration-150 ease-in-out focus:outline-none ${
92-
activeTab.value === tabId // Use captured primitive value
93-
? "border-[#D98E73] text-[#C27B62]"
94-
: "border-transparent text-[#6D5D4E] hover:border-gray-300 hover:text-[#5B3E29]"
95-
}`}
81+
class={`group inline-flex shrink-0 items-center whitespace-nowrap border-b-2 px-1 py-4 text-base font-medium transition-colors duration-150 ease-in-out focus:outline-none ${activeTab.value === tabId // Use captured primitive value
82+
? "border-[#D98E73] text-[#C27B62]"
83+
: "border-transparent text-[#6D5D4E] hover:border-gray-300 hover:text-[#5B3E29]"
84+
}`}
9685
aria-current={activeTab.value === tabId ? "page" : undefined} // Use captured primitive value
9786
>
98-
<TabIcon // Render the component directly
99-
class={`mr-2 h-5 w-5 ${
100-
activeTab.value === tabId // Use captured primitive value
101-
? "text-[#D98E73]"
102-
: "text-gray-400 group-hover:text-gray-500"
103-
}`}
104-
aria-hidden="true"
105-
/>
87+
88+
89+
10690
<span>{tabLabel}</span>
10791
{tabCount > 0 && (
10892
<span
109-
class={`ml-2.5 hidden rounded-full px-2.5 py-1 text-xs font-semibold md:inline-block ${
110-
activeTab.value === tabId // Use captured primitive value
111-
? "bg-[#FFF1E6] text-[#C27B62]"
112-
: "bg-gray-100 text-gray-600 group-hover:bg-gray-200"
113-
}`}
93+
class={`ml-2.5 hidden rounded-full px-2.5 py-1 text-xs font-semibold md:inline-block ${activeTab.value === tabId // Use captured primitive value
94+
? "bg-[#FFF1E6] text-[#C27B62]"
95+
: "bg-gray-100 text-gray-600 group-hover:bg-gray-200"
96+
}`}
11497
>
11598
{tabCount}
11699
</span>
@@ -130,11 +113,7 @@ export const TabsSection = component$<TabsSectionProps>(
130113
))}
131114
</div>
132115
) : (
133-
<EmptyState
134-
context="CalendarIcon" // Use context instead of icon
135-
title="No Upcoming Events"
136-
message="You haven't joined or been invited to any events yet. Explore events to join!"
137-
/>
116+
<h1 class="text-2xl font-bold text-center">No joined events</h1>
138117
))}
139118

140119
{activeTab.value === "hosted" &&
@@ -149,12 +128,7 @@ export const TabsSection = component$<TabsSectionProps>(
149128
))}
150129
</div>
151130
) : (
152-
<EmptyState
153-
context="UsersIcon" // Use context instead of icon (UserPlus mapped to UsersIcon context)
154-
title="No Hosted Events Yet"
155-
message="Ready to gather some folks? Host your first event and bring people together."
156-
actionButton={{ label: "Host an Event", href: "/create-event" }}
157-
/>
131+
<h1 class="text-2xl font-bold text-center">No Hosted Events</h1>
158132
))}
159133

160134
{activeTab.value === "saved" &&
@@ -165,12 +139,7 @@ export const TabsSection = component$<TabsSectionProps>(
165139
))}
166140
</div>
167141
) : (
168-
<EmptyState
169-
context="MapPinIcon" // Use context instead of icon (Heart mapped to MapPinIcon context for places)
170-
title="No Saved Places"
171-
message="Discover and save your favorite spots to easily find them later."
172-
actionButton={{ label: "Browse Spaces", href: "/spaces" }} // Assuming a browse spaces route
173-
/>
142+
<h1 class="text-2xl font-bold text-center">No Saved Places</h1>
174143
))}
175144
</div>
176145
</div>

src/routes/(app)/home/detailed-event-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const DetailedEventCard = component$(
3535
width={400}
3636
height={300}
3737
alt={props.event.title}
38-
class="h-full w-full object-cover"
38+
class=" h-auto md:h-56 lg:h-64 w-full object-cover max-h-full"
3939
/>
4040
<div class="absolute left-3 top-3 rounded-full bg-white/90 px-3 py-1 text-sm font-medium text-[#D98E73]">
4141
{props.event.badge}

src/routes/profile/index.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import type {
2424
import { ProfileHeader } from "@/components/profile/ProfileHeader";
2525
import { TabsSection } from "@/components/profile/TabsSection";
2626
import { CreateEventCTA } from "@/components/profile/CreateEventCTA";
27-
import { ActiveRequestsSidebar } from "@/components/profile/ActiveRequestsSidebar";
2827

2928
// --- Qwik Actions & Loaders ---
3029

@@ -84,8 +83,8 @@ export default component$(() => {
8483
profileStore.skills =
8584
typeof user.Intrests === "string"
8685
? user.Intrests.split(",")
87-
.map((s) => s.trim())
88-
.filter(Boolean)
86+
.map((s) => s.trim())
87+
.filter(Boolean)
8988
: Array.isArray(user.Intrests)
9089
? user.Intrests
9190
: [];
@@ -205,14 +204,6 @@ export default component$(() => {
205204
hostedEvents={hostedEvents.value}
206205
savedPlaces={savedPlaces.value} // Use dynamic savedPlaces from loader
207206
/>
208-
209-
{data.value.activeRequest && data.value.activeRequest.length > 0 && (
210-
<div class="mt-8 lg:mt-0 lg:pl-8">
211-
{" "}
212-
{/* Add margin top for spacing */}
213-
<ActiveRequestsSidebar requests={data.value.activeRequest} />
214-
</div>
215-
)}
216207
</div>
217208
</div>
218209
<CreateEventCTA />

0 commit comments

Comments
 (0)