Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Refine home styles (#38903)

Saxon Fletcher0c8359ca0ff2
diff --git a/apps/design-system/registry/default/example/logs-bar-chart.tsx b/apps/design-system/registry/default/example/logs-bar-chart.tsx
index e639f355f1a..2c348594f15 100644
--- a/apps/design-system/registry/default/example/logs-bar-chart.tsx
+++ b/apps/design-system/registry/default/example/logs-bar-chart.tsx
@@ -14,7 +14,7 @@ export default function LogsBarChartDemo() {
}).reverse()
return (
- <div className="w-full">
+ <div className="w-full h-64">
<LogsBarChart data={data} />
</div>
)
diff --git a/apps/studio/components/interfaces/HomeNew/AdvisorSection.tsx b/apps/studio/components/interfaces/HomeNew/AdvisorSection.tsx
index 710b4c1f0ec..e3a5b9d3cf7 100644
--- a/apps/studio/components/interfaces/HomeNew/AdvisorSection.tsx
+++ b/apps/studio/components/interfaces/HomeNew/AdvisorSection.tsx
@@ -85,7 +85,7 @@ export const AdvisorSection = () => {
return (
<Card
key={lint.cache_key}
- className="h-full flex flex-col items-stretch cursor-pointer"
+ className="min-h-full flex flex-col items-stretch cursor-pointer h-64"
onClick={() => {
handleCardClick(lint)
}}
diff --git a/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.tsx b/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.tsx
index e555e13aa49..e5fa1e266c1 100644
--- a/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.tsx
+++ b/apps/studio/components/interfaces/HomeNew/GettingStarted/GettingStarted.tsx
@@ -132,7 +132,7 @@ export function GettingStarted({ steps }: GettingStartedProps) {
<div className="relative w-full flex-1 min-h-[100px] shrink-0 overflow-hidden">
{activeStep.image ? (
<Image
- className="w-full select-none"
+ className="w-full select-none invert dark:invert-0"
src={activeStep.image}
fill
objectFit="cover"
diff --git a/apps/studio/components/interfaces/HomeNew/ProjectUsageSection.tsx b/apps/studio/components/interfaces/HomeNew/ProjectUsageSection.tsx
index a7a98b51cf4..8bc23ebab98 100644
--- a/apps/studio/components/interfaces/HomeNew/ProjectUsageSection.tsx
+++ b/apps/studio/components/interfaces/HomeNew/ProjectUsageSection.tsx
@@ -344,7 +344,7 @@ export const ProjectUsageSection = () => {
</div>
<Row columns={[3, 2, 1]}>
{enabledServices.map((s) => (
- <Card key={s.key} className="mb-0 md:mb-0 h-full flex flex-col">
+ <Card key={s.key} className="mb-0 md:mb-0 h-full flex flex-col h-64">
<CardHeader className="flex flex-row items-end justify-between gap-2 space-y-0 pb-0 border-b-0">
<div className="flex items-center gap-2">
<div className="flex flex-col">
@@ -373,15 +373,19 @@ export const ProjectUsageSection = () => {
</div>
</div>
</CardHeader>
- <CardContent className="p-6 pt-4 flex-1">
- <Loading active={isLoading}>
+ <CardContent className="p-6 pt-4 flex-1 h-full overflow-hidden">
+ <Loading isFullHeight active={isLoading}>
<LogsBarChart
data={s.data}
- height="120px"
DateTimeFormat={datetimeFormat}
onBarClick={handleBarClick(s.route)}
+ isFullHeight
EmptyState={
- <NoDataPlaceholder size="small" message="No data for selected period" />
+ <NoDataPlaceholder
+ size="small"
+ message="No data for selected period"
+ isFullHeight
+ />
}
/>
</Loading>
diff --git a/apps/studio/components/ui/Charts/NoDataPlaceholder.tsx b/apps/studio/components/ui/Charts/NoDataPlaceholder.tsx
index 31ff9b9f669..93bb8102bb9 100644
--- a/apps/studio/components/ui/Charts/NoDataPlaceholder.tsx
+++ b/apps/studio/components/ui/Charts/NoDataPlaceholder.tsx
@@ -12,6 +12,7 @@ interface NoDataPlaceholderProps {
description?: string
className?: string
size: Parameters<typeof useChartSize>[0]
+ isFullHeight?: boolean
}
const NoDataPlaceholder = ({
attribute,
@@ -20,17 +21,19 @@ const NoDataPlaceholder = ({
format,
className = '',
size,
+ isFullHeight = false,
}: NoDataPlaceholderProps) => {
const { minHeight } = useChartSize(size)
return (
- <div>
+ <div className={cn(isFullHeight && 'h-full')}>
{attribute !== undefined && (
<ChartHeader title={attribute} format={format} highlightedValue={0} />
)}
<div
className={cn(
'border-control flex flex-grow w-full flex-col items-center justify-center space-y-2 border border-dashed text-center',
+ isFullHeight && 'h-full',
className
)}
// extra 20 px for the x ticks
diff --git a/packages/ui-patterns/src/LogsBarChart/index.tsx b/packages/ui-patterns/src/LogsBarChart/index.tsx
index 6d5e805503c..a7ff1985a7d 100644
--- a/packages/ui-patterns/src/LogsBarChart/index.tsx
+++ b/packages/ui-patterns/src/LogsBarChart/index.tsx
@@ -26,13 +26,13 @@ export const LogsBarChart = ({
onBarClick,
EmptyState,
DateTimeFormat = 'MMM D, YYYY, hh:mma',
- height = '80px',
+ isFullHeight = false,
}: {
data: LogsBarChartDatum[]
onBarClick?: (datum: LogsBarChartDatum, tooltipData?: CategoricalChartState) => void
EmptyState?: ReactNode
DateTimeFormat?: string
- height?: string
+ isFullHeight?: boolean
}) => {
const [focusDataIndex, setFocusDataIndex] = useState<number | null>(null)
@@ -45,8 +45,12 @@ export const LogsBarChart = ({
const endDate = dayjs(data[data?.length - 1]?.['timestamp']).format(DateTimeFormat)
return (
- <div data-testid="logs-bar-chart" className={cn('flex flex-col gap-y-3')}>
+ <div
+ data-testid="logs-bar-chart"
+ className={cn('flex flex-col gap-y-3', isFullHeight ? 'h-full' : 'h-24')}
+ >
<ChartContainer
+ className="h-full"
config={
{
error_count: {
@@ -60,7 +64,6 @@ export const LogsBarChart = ({
},
} satisfies ChartConfig
}
- style={{ height }}
>
<RechartBarChart
data={data}
diff --git a/packages/ui/src/components/Loading/Loading.tsx b/packages/ui/src/components/Loading/Loading.tsx
index 704557cc643..330ba09d668 100644
--- a/packages/ui/src/components/Loading/Loading.tsx
+++ b/packages/ui/src/components/Loading/Loading.tsx
@@ -1,13 +1,14 @@
import React from 'react'
import { Loader2 } from 'lucide-react'
-
import styleHandler from '../../lib/theme/styleHandler'
+import { cn } from '../../lib/utils/cn'
interface Props {
children: React.ReactNode
active: boolean
+ isFullHeight?: boolean
}
-export default function Loading({ children, active }: Props) {
+export default function Loading({ children, active, isFullHeight = false }: Props) {
const __styles = styleHandler('loading')
let classNames = [__styles.base]
@@ -21,8 +22,8 @@ export default function Loading({ children, active }: Props) {
let spinnerClasses = [__styles.spinner]
return (
- <div className={classNames.join(' ')}>
- <div className={contentClasses.join(' ')}>{children}</div>
+ <div className={cn(classNames.join(' '), isFullHeight && 'h-full')}>
+ <div className={cn(contentClasses.join(' '), isFullHeight && 'h-full')}>{children}</div>
{active && <Loader2 size={24} className={spinnerClasses.join(' ')} />}
</div>
)