mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
fix: ResponsiveContainer warning
This commit is contained in:
1 parent
3e1e7d5a38
commit
e8dfde91dc
1 file changed
+10
-5
@@ -200,6 +200,9 @@ export function BarChart({
|
||||
|
||||
const day = (value: number | string) => (displayDateInUtc ? dayjs(value).utc() : dayjs(value))
|
||||
|
||||
// For future reference: https://github.com/supabase/supabase/pull/5311#discussion_r800852828
|
||||
const chartHeight = minimalChart ? 96 : 160
|
||||
|
||||
return (
|
||||
<Loading active={!data}>
|
||||
<div className={className}>
|
||||
@@ -214,10 +217,10 @@ export function BarChart({
|
||||
customDateFormat={customDateFormat}
|
||||
displayDateInUtc={displayDateInUtc}
|
||||
/>
|
||||
<div style={{ width: '100%', height: minimalChart ? '96px' : '160px' }}>
|
||||
<div style={{ width: '100%', height: `${chartHeight}px` }}>
|
||||
{hasData ? (
|
||||
<>
|
||||
<ResponsiveContainer>
|
||||
<ResponsiveContainer width="100%" height={chartHeight}>
|
||||
<RechartBarChart
|
||||
data={data}
|
||||
margin={{
|
||||
@@ -270,7 +273,6 @@ export function BarChart({
|
||||
/>
|
||||
))}
|
||||
</Bar>
|
||||
</Bar>
|
||||
</RechartBarChart>
|
||||
</ResponsiveContainer>
|
||||
{data && (
|
||||
@@ -326,6 +328,9 @@ export function AreaChart({
|
||||
setMouseLeave(true)
|
||||
}
|
||||
|
||||
// For future reference: https://github.com/supabase/supabase/pull/5311#discussion_r800852828
|
||||
const chartHeight = 160
|
||||
|
||||
return (
|
||||
<Loading active={!data}>
|
||||
<Header
|
||||
@@ -340,12 +345,12 @@ export function AreaChart({
|
||||
<div
|
||||
style={{
|
||||
width: '100%',
|
||||
height: '160px',
|
||||
height: `${chartHeight}px`,
|
||||
}}
|
||||
>
|
||||
{hasData ? (
|
||||
<>
|
||||
<ResponsiveContainer width="100%" height={160}>
|
||||
<ResponsiveContainer width="100%" height={chartHeight}>
|
||||
<RechartAreaChart
|
||||
data={data}
|
||||
margin={{
|
||||
|
||||
Reference in new issue
Block a user