mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-29 03:59:54 +02:00
Hide upgrade button for paid users.
This commit is contained in:
1
.astro/types.d.ts
vendored
1
.astro/types.d.ts
vendored
@@ -1,2 +1 @@
|
|||||||
/// <reference types="astro/client" />
|
/// <reference types="astro/client" />
|
||||||
/// <reference path="content.d.ts" />
|
|
@@ -6,6 +6,7 @@ import { NavigationDropdown } from '../NavigationDropdown';
|
|||||||
import { RoadmapDropdownMenu } from '../TopNavDropdowns/RoadmapDropdownMenu';
|
import { RoadmapDropdownMenu } from '../TopNavDropdowns/RoadmapDropdownMenu';
|
||||||
import { AIDropdownMenu } from '../TopNavDropdowns/AIDropdownMenu';
|
import { AIDropdownMenu } from '../TopNavDropdowns/AIDropdownMenu';
|
||||||
import { AccountDropdown } from './AccountDropdown';
|
import { AccountDropdown } from './AccountDropdown';
|
||||||
|
import { UpgradeProButton } from '../TopNavDropdowns/UpgradeProButton';
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class='bg-slate-900 py-5 text-white sm:py-8'>
|
<div class='bg-slate-900 py-5 text-white sm:py-8'>
|
||||||
@@ -31,13 +32,7 @@ import { AccountDropdown } from './AccountDropdown';
|
|||||||
<NavigationDropdown client:load />
|
<NavigationDropdown client:load />
|
||||||
<RoadmapDropdownMenu client:load />
|
<RoadmapDropdownMenu client:load />
|
||||||
<AIDropdownMenu client:load />
|
<AIDropdownMenu client:load />
|
||||||
<a
|
<UpgradeProButton client:only='react' />
|
||||||
href='/premium'
|
|
||||||
class='group relative hidden items-center gap-1.5 font-medium text-yellow-400 transition-all duration-200 hover:text-yellow-300 xl:flex'
|
|
||||||
>
|
|
||||||
<Icon icon='bolt' />
|
|
||||||
Upgrade to Pro
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
20
src/components/TopNavDropdowns/UpgradeProButton.tsx
Normal file
20
src/components/TopNavDropdowns/UpgradeProButton.tsx
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import { Zap } from 'lucide-react';
|
||||||
|
import { useIsPaidUser } from '../../queries/billing';
|
||||||
|
import { cn } from '../../lib/classname';
|
||||||
|
|
||||||
|
export function UpgradeProButton() {
|
||||||
|
const { isPaidUser, isLoading } = useIsPaidUser();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<a
|
||||||
|
href="/premium"
|
||||||
|
className={cn(
|
||||||
|
'group animate-fade-in relative hidden items-center gap-1.5 font-medium text-yellow-400 transition-all duration-200 hover:text-yellow-300 xl:flex',
|
||||||
|
(isPaidUser || isLoading) && 'hidden!',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<Zap className="h-4 w-4 fill-current" />
|
||||||
|
Upgrade to Pro
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
}
|
Reference in New Issue
Block a user