mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-01 10:11:50 +02:00
✨ Show Pro badge in sidebar (#1251)
This commit is contained in:
parent
af05d1ebca
commit
1300ed0ecb
2 changed files with 23 additions and 1 deletions
|
@ -2,6 +2,7 @@ import { cn } from "@rallly/ui";
|
|||
import React from "react";
|
||||
|
||||
import { MobileNavigation } from "@/app/[locale]/(admin)/mobile-navigation";
|
||||
import { ProBadge } from "@/app/[locale]/(admin)/pro-badge";
|
||||
import { Sidebar } from "@/app/[locale]/(admin)/sidebar";
|
||||
import { LogoLink } from "@/app/components/logo-link";
|
||||
|
||||
|
@ -17,8 +18,9 @@ export default async function Layout({
|
|||
"fixed inset-y-0 z-50 hidden w-72 shrink-0 flex-col gap-y-4 overflow-y-auto p-6 py-5 md:flex",
|
||||
)}
|
||||
>
|
||||
<div>
|
||||
<div className="flex w-full items-center justify-between gap-4">
|
||||
<LogoLink />
|
||||
<ProBadge />
|
||||
</div>
|
||||
<Sidebar />
|
||||
</div>
|
||||
|
|
20
apps/web/src/app/[locale]/(admin)/pro-badge.tsx
Normal file
20
apps/web/src/app/[locale]/(admin)/pro-badge.tsx
Normal file
|
@ -0,0 +1,20 @@
|
|||
"use client";
|
||||
|
||||
import { Badge } from "@rallly/ui/badge";
|
||||
|
||||
import { Trans } from "@/components/trans";
|
||||
import { useUser } from "@/components/user-provider";
|
||||
|
||||
export function ProBadge() {
|
||||
const { user } = useUser();
|
||||
|
||||
if (user.tier !== "pro") {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Badge variant="primary">
|
||||
<Trans i18nKey="planPro" />
|
||||
</Badge>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue