mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 20:35:07 +03:00
* chore: move to deeper dark * tidy up boxes on www * update deep-dark colors * fix homepage product cards * toned down pricing page a little * update * lots of color changes * Update grid.scss * Update EntityListItem.tsx * Update EntityListItem.tsx * fix partners page icon * fix partners page colors * update theme * Update global.css * combined dark theme so classic-dark does not break on other sites * Update package-lock.json * updated color tokens pipeline to support combined dark theme * smol updates * Update FeaturedThumb.tsx * Update BlogFilters.tsx * Update BlogListItem.tsx * Update BlogListItem.tsx * Update UserSettingsDropdown.tsx * Update NavigationBar.tsx --------- Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
58 lines
1.4 KiB
TypeScript
58 lines
1.4 KiB
TypeScript
import { PropsWithChildren, ReactNode } from 'react'
|
|
import { Loading, cn } from 'ui'
|
|
|
|
interface PanelProps {
|
|
className?: string
|
|
footer?: JSX.Element | false
|
|
loading?: boolean
|
|
noMargin?: boolean
|
|
title?: ReactNode | false
|
|
wrapWithLoading?: boolean
|
|
noHideOverflow?: boolean
|
|
titleClasses?: string
|
|
}
|
|
|
|
function Panel(props: PropsWithChildren<PanelProps>) {
|
|
const content = (
|
|
<div
|
|
className={cn(
|
|
'bg-surface-100',
|
|
'rounded-md border shadow-sm',
|
|
props.noHideOverflow ? '' : 'overflow-hidden',
|
|
props.noMargin ? '' : 'mb-8',
|
|
props.className
|
|
)}
|
|
>
|
|
{props.title && (
|
|
<div
|
|
className={cn(
|
|
'bg-surface-100 border-b border-default flex items-center px-6 py-4',
|
|
props.titleClasses
|
|
)}
|
|
>
|
|
{props.title}
|
|
</div>
|
|
)}
|
|
{props.children}
|
|
{props.footer && (
|
|
<div className="bg-surface-100 border-t border-default">
|
|
<div className="flex h-12 items-center px-6">{props.footer}</div>
|
|
</div>
|
|
)}
|
|
</div>
|
|
)
|
|
|
|
if (props.wrapWithLoading === false) {
|
|
return content
|
|
}
|
|
|
|
return <Loading active={Boolean(props.loading)}>{content}</Loading>
|
|
}
|
|
|
|
function Content({ children, className }: { children: ReactNode; className?: string | false }) {
|
|
return <div className={cn('px-6 py-4', className)}>{children}</div>
|
|
}
|
|
|
|
Panel.Content = Content
|
|
export default Panel
|