Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/components/NavbarAuthControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ChatCircleIcon } from '@phosphor-icons/react/ChatCircle'
import { SignInIcon } from '@phosphor-icons/react/SignIn'
import { SignOutIcon } from '@phosphor-icons/react/SignOut'
import { SparkleIcon } from '@phosphor-icons/react/Sparkle'
import { Link, useNavigate } from '@tanstack/react-router'
import { ClientOnly, Link, useNavigate } from '@tanstack/react-router'
import { twMerge } from 'tailwind-merge'
import {
Authenticated,
Expand Down Expand Up @@ -81,7 +81,7 @@ export function NavbarAuthControls({ className }: NavbarAuthControlsProps) {
)

return (
<>
<ClientOnly fallback={loadingPlaceholder}>
<AuthLoading>{loadingPlaceholder}</AuthLoading>
<Unauthenticated>{loginButton}</Unauthenticated>
<Authenticated>
Expand All @@ -94,7 +94,7 @@ export function NavbarAuthControls({ className }: NavbarAuthControlsProps) {
/>
</React.Suspense>
</Authenticated>
</>
</ClientOnly>
)
}

Expand Down Expand Up @@ -150,7 +150,7 @@ export function MobileNavbarAuthControls({
)

return (
<>
<ClientOnly fallback={loadingPlaceholder}>
<AuthLoading>{loadingPlaceholder}</AuthLoading>
<Unauthenticated>{signIn}</Unauthenticated>
<Authenticated>
Expand Down Expand Up @@ -214,6 +214,6 @@ export function MobileNavbarAuthControls({
Sign Out
</button>
</Authenticated>
</>
</ClientOnly>
)
}
86 changes: 0 additions & 86 deletions src/components/landing/ChartsCatalogGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,92 +8,6 @@ import { shuffleWithSeed } from '~/utils/utils'
type ChartsLandingCatalog = Awaited<ReturnType<typeof getChartsCatalogLanding>>
type CatalogCase = ChartsLandingCatalog['cases'][number]

export const chartsLandingHeroCaseIds = [
'70-composed-chart',
'101-sunburst',
'127-shadcn-dashboard',
] as const

export function CatalogChartsHero({
catalog,
}: {
catalog: ChartsLandingCatalog
}) {
const casesById = new Map(
catalog.cases.map((catalogCase) => [catalogCase.id, catalogCase]),
)
const heroCases = chartsLandingHeroCaseIds.flatMap((caseId) => {
const catalogCase = casesById.get(caseId)
return catalogCase ? [catalogCase] : []
})

if (heroCases.length === 0) return null

return (
<section
aria-label="Chart catalog examples"
className="library-landing-graphic min-w-0"
>
<div className="grid grid-cols-2 gap-3 sm:grid-cols-[minmax(0,2fr)_minmax(0,1fr)] sm:grid-rows-2">
{heroCases.map((catalogCase, index) => (
<HeroChartTile
catalogCase={catalogCase}
featured={index === 0}
key={catalogCase.id}
revision={catalog.revision}
/>
))}
</div>
</section>
)
}

function HeroChartTile({
catalogCase,
featured,
revision,
}: {
catalogCase: CatalogCase
featured: boolean
revision: string
}) {
return (
<figure
className={
featured ? 'col-span-2 min-w-0 sm:col-span-1 sm:row-span-2' : 'min-w-0'
}
>
<div className="group relative overflow-hidden rounded-2xl corner-squircle border border-border-subtle bg-background-surface shadow-[0_24px_55px_-28px_rgb(3_18_25/0.42)]">
<div className="aspect-[3/2]">
<ChartsCatalogPreview caseId={catalogCase.id} revision={revision} />
</div>
<Link
aria-label={`Open the ${catalogCase.title} catalog example`}
className="absolute inset-0 rounded-2xl focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--landing-accent-bright)] focus-visible:ring-offset-4 focus-visible:ring-offset-background-default"
params={{ caseId: catalogCase.id }}
preload={false}
search={{}}
to="/charts/catalog/charts/$caseId"
>
<ArrowUpRightIcon
aria-hidden="true"
className="absolute right-4 top-4 size-5 text-text-muted"
/>
</Link>
</div>

<figcaption className="mt-2 min-w-0 px-1">
<p className="truncate font-ds-display text-sm font-semibold text-text-primary xl:text-base">
{catalogCase.title}
</p>
<p className="mt-0.5 font-ds-mono text-ds-mono-caps-xs uppercase text-text-muted">
{catalogCase.family}
</p>
</figcaption>
</figure>
)
}

export function ChartsCatalogGallery({
catalog,
orderSeed,
Expand Down
Loading
Loading