feat: add logo tile
This commit is contained in:
parent
bed79e616d
commit
a8c10d34d6
34
app/components/ui/logo-tile.tsx
Normal file
34
app/components/ui/logo-tile.tsx
Normal file
@ -0,0 +1,34 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import { cva } from 'class-variance-authority';
|
||||
import { ClientLogo } from '~/components/ui/client-logo';
|
||||
import { cn } from '~/lib/utils';
|
||||
import type { BrandIdentity } from '~/types/project';
|
||||
|
||||
const tileVariants = cva('relative flex items-center justify-center overflow-hidden', {
|
||||
variants: {
|
||||
size: {
|
||||
// Padding is the room around the logo, which fills the rest
|
||||
card: 'h-[150px] w-full rounded-control p-6',
|
||||
header: 'h-24 w-[200px] shrink-0 rounded-card px-6 py-4',
|
||||
field: 'h-14 w-[120px] shrink-0 rounded-item p-2',
|
||||
},
|
||||
background: { light: 'bg-logo-tile-light', dark: 'bg-logo-tile-dark' },
|
||||
},
|
||||
});
|
||||
|
||||
interface LogoTileProps {
|
||||
brand: BrandIdentity;
|
||||
size: 'card' | 'header' | 'field';
|
||||
className?: string;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
// The client logo on a tile coloured by the project's logo background (admin screens)
|
||||
export function LogoTile({ brand, size, className, children }: LogoTileProps) {
|
||||
return (
|
||||
<div className={cn(tileVariants({ size, background: brand.logoBg }), className)} style={brand.logoBgColor ? { backgroundColor: brand.logoBgColor } : undefined}>
|
||||
<ClientLogo brand={brand} variant='plain' size='fill' />
|
||||
{children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user