Add public profiles and cosmetic shop
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 7m10s

This commit is contained in:
2026-10-15 17:30:10 +05:00
parent 44e62cff2f
commit c541cc09b4
28 changed files with 1359 additions and 45 deletions

43
app/cosmetics/page.tsx Normal file
View File

@@ -0,0 +1,43 @@
import Link from "next/link";
import { redirect } from "next/navigation";
import { ArrowLeft } from "lucide-react";
import { CosmeticsShop } from "@/components/CosmeticsShop";
import { Footer, Header } from "@/components/Shell";
import { getI18n } from "@/lib/i18n";
import { accountProfile } from "@/lib/profile";
import { profileCosmeticsState } from "@/lib/profile-cosmetics";
import { user } from "@/lib/supabase";
export const dynamic = "force-dynamic";
export async function generateMetadata() {
const { t } = await getI18n();
return { title: t("Profile cosmetics") };
}
export default async function CosmeticsPage() {
const account = await user();
if (!account) redirect("/log-in?next=%2Fcosmetics");
const [profile, shop] = await Promise.all([
accountProfile(account),
profileCosmeticsState(account.id),
]);
const { t } = await getI18n();
return (
<>
<Header />
<main className="section page-content">
<Link className="text-link" href="/dashboard">
<ArrowLeft size={15} aria-hidden="true" /> {t("My account")}
</Link>
<CosmeticsShop
accountId={account.id}
avatarPath={profile.avatar_path}
initialShop={shop}
/>
</main>
<Footer />
</>
);
}