Skip to content

Commit 2f8c1e8

Browse files
authored
Merge pull request #356 from codeunia-dev/fix/rbac
feat: Display company logos or initials on event and hackathon cards
2 parents 495ae02 + 54609c2 commit 2f8c1e8

File tree

5 files changed

+152
-151
lines changed

5 files changed

+152
-151
lines changed

app/companies/[slug]/events/page.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,19 @@ export default function CompanyEventsPage() {
356356
{/* Card Content */}
357357
<div className="flex-1 flex flex-col p-4">
358358
<div className="flex items-center gap-3 mb-2">
359-
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-primary to-purple-600 flex items-center justify-center text-white font-bold text-lg shadow-lg">
360-
{event.organizer.split(" ").map((n: string) => n[0]).join("")}
359+
{/* Company Logo/Badge */}
360+
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-primary to-purple-600 flex items-center justify-center text-white font-bold text-sm shadow-lg overflow-hidden">
361+
{company?.logo_url ? (
362+
<Image
363+
src={company.logo_url}
364+
alt={company.name}
365+
width={40}
366+
height={40}
367+
className="object-cover w-full h-full"
368+
/>
369+
) : (
370+
company?.name.substring(0, 2).toUpperCase()
371+
)}
361372
</div>
362373
<div className="flex-1 min-w-0">
363374
<div className="flex items-start justify-between gap-2">
@@ -413,11 +424,10 @@ export default function CompanyEventsPage() {
413424
</div>
414425
<Badge
415426
variant="outline"
416-
className={`text-xs ${
417-
event.payment === "Required" || event.payment === "Paid"
427+
className={`text-xs ${event.payment === "Required" || event.payment === "Paid"
418428
? "border-green-200 text-green-700 bg-green-50"
419429
: "border-blue-200 text-blue-700 bg-blue-50"
420-
}`}
430+
}`}
421431
>
422432
{event.payment === "Required" || event.payment === "Paid" ? "Paid" : "Free"}
423433
</Badge>

app/companies/[slug]/hackathons/page.tsx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,19 @@ export default function CompanyHackathonsPage() {
309309
{/* Card Content */}
310310
<div className="flex-1 flex flex-col p-4">
311311
<div className="flex items-center gap-3 mb-2">
312-
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-primary to-purple-600 flex items-center justify-center text-white shadow-lg">
313-
<Trophy className="h-5 w-5" />
312+
{/* Company Logo/Badge */}
313+
<div className="w-10 h-10 rounded-full bg-gradient-to-br from-primary to-purple-600 flex items-center justify-center text-white font-bold text-sm shadow-lg overflow-hidden">
314+
{company?.logo_url ? (
315+
<Image
316+
src={company.logo_url}
317+
alt={company.name}
318+
width={40}
319+
height={40}
320+
className="object-cover w-full h-full"
321+
/>
322+
) : (
323+
company?.name.substring(0, 2).toUpperCase()
324+
)}
314325
</div>
315326
<div className="flex-1 min-w-0">
316327
<div className="flex items-start justify-between gap-2">
@@ -340,19 +351,19 @@ export default function CompanyHackathonsPage() {
340351
<Calendar className="h-3 w-3" />
341352
{hackathon.date && !isNaN(new Date(hackathon.date).getTime())
342353
? new Date(hackathon.date).toLocaleDateString("en-US", {
343-
month: "short",
344-
day: "numeric",
345-
year: "numeric",
346-
})
354+
month: "short",
355+
day: "numeric",
356+
year: "numeric",
357+
})
347358
: "TBA"}
348359
</div>
349360
<div className="flex items-center gap-1">
350361
<Clock className="h-3 w-3" />
351362
{hackathon.registration_deadline && !isNaN(new Date(hackathon.registration_deadline).getTime())
352363
? `Reg: ${new Date(hackathon.registration_deadline).toLocaleDateString("en-US", {
353-
month: "short",
354-
day: "numeric",
355-
})}`
364+
month: "short",
365+
day: "numeric",
366+
})}`
356367
: hackathon.duration || "TBA"}
357368
</div>
358369
<div className="flex items-center gap-1">
@@ -387,7 +398,7 @@ export default function CompanyHackathonsPage() {
387398
className="font-semibold px-6 py-2 rounded-full text-base bg-gradient-to-r from-primary to-purple-600 hover:from-primary/90 hover:to-purple-600/90 shadow-lg"
388399
asChild
389400
>
390-
<Link href={`/hackathons/${hackathon.id}`}>
401+
<Link href={`/hackathons/${hackathon.slug}`}>
391402
View Details <ArrowRight className="ml-1 h-5 w-5" />
392403
</Link>
393404
</Button>

app/companies/register/page.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ export default function CompanyRegisterPage() {
7272
</CardHeader>
7373
<CardContent className="text-center space-y-6">
7474
<p className="text-sm text-muted-foreground">
75-
You need to be signed in to register your company. This helps us track your
75+
You need to be signed in to register your company. This helps us track your
7676
application and provide better support throughout the verification process.
7777
</p>
7878
<div className="flex flex-col sm:flex-row gap-4 justify-center">
79-
<Button
79+
<Button
8080
className="bg-gradient-to-r from-blue-500 to-cyan-500 hover:from-blue-600 hover:to-cyan-600 text-white"
8181
asChild
8282
>
@@ -131,7 +131,7 @@ export default function CompanyRegisterPage() {
131131
</p>
132132
</div>
133133
</div>
134-
134+
135135
<div className="flex gap-4">
136136
<div className="flex-shrink-0">
137137
<div className="w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center font-semibold">
@@ -145,7 +145,7 @@ export default function CompanyRegisterPage() {
145145
</p>
146146
</div>
147147
</div>
148-
148+
149149
<div className="flex gap-4">
150150
<div className="flex-shrink-0">
151151
<div className="w-8 h-8 rounded-full bg-blue-500 text-white flex items-center justify-center font-semibold">
@@ -232,14 +232,14 @@ export default function CompanyRegisterPage() {
232232
</div>
233233
<h1 className="text-4xl font-bold tracking-tight">Register Your Company</h1>
234234
<p className="text-lg text-muted-foreground max-w-2xl mx-auto">
235-
Join CodeUnia&apos;s marketplace and start hosting hackathons and events for the developer community
235+
Join Codeunia&apos;s marketplace and start hosting hackathons and events for the developer community
236236
</p>
237237
</div>
238238

239239
{/* Benefits */}
240240
<Card className="border-0 shadow-lg bg-gradient-to-r from-blue-50 to-cyan-50 dark:from-blue-900/20 dark:to-cyan-900/20">
241241
<CardContent className="p-6">
242-
<h3 className="font-semibold text-lg mb-4">Why host events on CodeUnia?</h3>
242+
<h3 className="font-semibold text-lg mb-4">Why host events on Codeunia?</h3>
243243
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
244244
<div className="flex gap-3">
245245
<CheckCircle2 className="h-5 w-5 text-green-600 dark:text-green-400 flex-shrink-0 mt-0.5" />

0 commit comments

Comments
 (0)