feat: add AR page header
This commit is contained in:
parent
9f96a34930
commit
4934fc3f67
29
app/components/ui/ar-page-header.tsx
Normal file
29
app/components/ui/ar-page-header.tsx
Normal file
@ -0,0 +1,29 @@
|
||||
import { ClientLogo } from '~/components/ui/client-logo';
|
||||
import { LogoMark } from '~/components/ui/logo-mark';
|
||||
import { Text } from '~/components/ui/text';
|
||||
import { cn } from '~/lib/utils';
|
||||
import type { ArPageLayout, BrandIdentity } from '~/types/project';
|
||||
|
||||
interface ArPageHeaderProps {
|
||||
brand?: BrandIdentity;
|
||||
modelName: string;
|
||||
layout: ArPageLayout;
|
||||
// Placement, e.g. over the model
|
||||
className?: string;
|
||||
}
|
||||
|
||||
// Client logo top-left with the model name under it; the thob mark top-right. Each part can be turned off per project.
|
||||
export function ArPageHeader({ brand, modelName, layout, className }: ArPageHeaderProps) {
|
||||
return (
|
||||
<header className={cn('flex items-start justify-between gap-3 px-4 pt-[calc(18px+env(safe-area-inset-top))]', className)}>
|
||||
<div className='flex min-w-0 flex-col items-start gap-2.5'>
|
||||
{brand && <ClientLogo brand={brand} variant={layout.logoBacking ? 'chip' : 'bare'} size='md' />}
|
||||
{/* A hidden name stays for screen readers: it is the page heading */}
|
||||
<Text as='h1' variant='subheading' tone='ink' truncate className={cn('max-w-full', !layout.modelName && 'sr-only')}>
|
||||
{modelName}
|
||||
</Text>
|
||||
</div>
|
||||
{layout.thobLogo && <LogoMark size='md' surface='viewer' />}
|
||||
</header>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user