add user profile, profile vibe and trip vibe and social signal

This commit is contained in:
2026-05-08 19:20:27 +07:00
parent 3228ef712f
commit 7f419638b5
39 changed files with 1361 additions and 192 deletions
+13
View File
@@ -35,6 +35,12 @@ export function Navbar() {
>
Open Trip
</Link>
<Link
href="/people"
className="rounded-lg px-3 py-1.5 text-sm font-medium text-neutral-600 transition-colors hover:bg-neutral-100 hover:text-neutral-800"
>
Cari Teman
</Link>
{session?.user ? (
<>
@@ -125,6 +131,13 @@ export function Navbar() {
>
Open Trip
</Link>
<Link
href="/people"
onClick={() => setMenuOpen(false)}
className="rounded-lg px-3 py-2.5 text-sm font-medium text-neutral-700 transition-colors hover:bg-neutral-50"
>
Cari Teman
</Link>
{session?.user ? (
<>
@@ -0,0 +1,41 @@
import Link from "next/link";
import { getServerSession } from "next-auth";
import { authOptions } from "@/lib/auth";
import { profileRepo } from "@/server/repositories/profile.repo";
/**
* Server component banner: muncul di atas semua halaman ketika user sudah login
* tapi profil sosialnya kosong. Menjaga janji "kenalan dulu, gabung kemudian"
* dengan mendorong user mengisi minat/kota sebelum join trip.
*/
export async function ProfileNudgeBanner() {
const session = await getServerSession(authOptions);
if (!session?.user?.id) return null;
const profile = await profileRepo.findByUserId(session.user.id);
const hasMeaningfulProfile =
!!profile &&
(!!profile.bio?.trim() ||
!!profile.city?.trim() ||
profile.interests.length > 0);
if (hasMeaningfulProfile) return null;
return (
<div className="border-b border-amber-200 bg-amber-50">
<div className="mx-auto flex max-w-6xl flex-col items-start gap-2 px-4 py-2.5 text-xs sm:flex-row sm:items-center sm:justify-between sm:text-sm">
<p className="text-amber-900">
<span className="font-semibold">Lengkapi profil sosial kamu</span>
bio, kota, dan minat. Calon teman trip akan lebih mudah kenal kamu
sebelum gabung bareng.
</p>
<Link
href="/profile"
className="shrink-0 rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-amber-700"
>
Isi profil sekarang
</Link>
</div>
</div>
);
}