chore(web): update dashboard banners

This commit is contained in:
isra el
2026-03-30 15:02:51 +03:00
parent 4da8570cd2
commit f64a520b86
3 changed files with 92 additions and 9 deletions

View File

@@ -0,0 +1,84 @@
'use client'
import { Alert, AlertDescription } from '@/components/ui/alert'
import { Button } from '@/components/ui/button'
import { ExternalLinks } from '@/config/external-links'
import { ArrowUpRight, ThumbsUp } from 'lucide-react'
import Link from 'next/link'
import { useMemo, useState } from 'react'
type BannerVariant = {
title: string
subtitle: string
cta: string
}
const TITLES = [
'Launch day: help keep textbee visible on uneed.best',
'Help others find textbee',
'textbee is live on uneed.best',
'Enjoying textbee so far?',
'Find us on uneed.best',
] as const
const SUBTITLES = [
'Thanks for being here,an upvote helps us reach more developers.',
'If youve found it useful, a quick upvote helps others discover it.',
'If textbee helped you, an upvote today makes a big difference.',
] as const
const CTA_TEXTS = [
'Upvote on uneed.best',
'View on uneed.best',
] as const
function pick<T>(items: readonly T[]) {
return items[Math.floor(Math.random() * items.length)]
}
export default function UneedUpvoteBanner() {
const variants = useMemo<BannerVariant[]>(
() =>
TITLES.flatMap((title) =>
SUBTITLES.map((subtitle) => ({
title,
subtitle,
cta: pick(CTA_TEXTS),
}))
),
[]
)
const [variant] = useState<BannerVariant>(() => pick(variants))
return (
<Alert className='border border-brand-200 dark:border-brand-800 bg-gradient-to-r from-brand-50 to-white dark:from-brand-950/50 dark:to-gray-900'>
<AlertDescription className='flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between'>
<div className='min-w-0'>
<div className='font-medium text-gray-900 dark:text-white'>
{variant.title}
</div>
<div className='text-sm text-gray-600 dark:text-gray-300'>
{variant.subtitle}
</div>
</div>
<div className='flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end'>
<Button asChild className='bg-brand-600 hover:bg-brand-700 text-white'>
<Link
href={ExternalLinks.uneed}
target='_blank'
rel='noopener noreferrer'
prefetch={false}
>
<ThumbsUp className='mr-2 h-4 w-4' />
{variant.cta}
<ArrowUpRight className='ml-2 h-4 w-4' />
</Link>
</Button>
</div>
</AlertDescription>
</Alert>
)
}

View File

@@ -3,12 +3,9 @@
import { Home, MessageSquareText, UserCircle, Users } from 'lucide-react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import AccountDeletionAlert from './(components)/account-deletion-alert'
import UpgradeToProAlert from './(components)/upgrade-to-pro-alert'
import UpdateAppModal from './(components)/update-app-modal'
import UpdateAppNotificationBar from './(components)/update-app-notification-bar'
import UneedUpvoteBanner from './(components)/uneed-upvote-banner'
import VerifyEmailAlert from './(components)/verify-email-alert'
import { SurveyModal } from '@/components/shared/survey-modal'
import AccountDeletionAlert from './(components)/account-deletion-alert'
export default function DashboardLayout({
children,
@@ -52,10 +49,11 @@ export default function DashboardLayout({
{/* Main content with left padding to account for fixed sidebar */}
<main className='flex-1 min-w-0 overflow-auto md:ml-24'>
<div className='space-y-2 p-4'>
<UpdateAppNotificationBar />
<UneedUpvoteBanner />
{/* <UpdateAppNotificationBar /> */}
<VerifyEmailAlert />
<AccountDeletionAlert />
<UpgradeToProAlert />
{/* <UpgradeToProAlert /> */}
{/* <BlackFridayModal /> */}
</div>
{children}
@@ -94,8 +92,8 @@ export default function DashboardLayout({
{/* Bottom padding for mobile to account for the fixed navigation */}
<div className='h-16 md:hidden'></div>
<SurveyModal />
<UpdateAppModal />
{/* <SurveyModal /> */}
{/* <UpdateAppModal /> */}
</div>
)
}

View File

@@ -5,4 +5,5 @@ export const ExternalLinks = {
polar: 'https://donate.textbee.dev',
twitter: 'https://x.com/textbeedotdev',
linkedin: 'https://www.linkedin.com/company/textbeedotdev',
uneed: 'https://www.uneed.best/tool/textbeedev-free-and-opensource-sms-gateway',
}