polish: reduce chart size

This commit is contained in:
TzeYiing authored and Copple committed 2022-03-30 17:07:40 +02:00
1 parent 5bab40b2cb
commit 3faa9edd3d
2 files changed
+9 -5

No files matched your search

@@ -17,7 +17,7 @@ const LogEventChart: React.FC<Props> = ({ data, onBarClick }) => {
return (
<BarChart
minimalHeader
minmalChart
chartSize="tiny"
data={aggregated}
attribute="count"
label="Events"
@@ -175,10 +175,10 @@ export function BarChart({
label,
onBarClick,
minimalHeader,
minimalChart,
chartSize = 'normal',
className = '',
noDataTitle,
noDataMessage
noDataMessage,
}: any) {
const hasData = data ? dataCheck(data, attribute) : true
@@ -203,7 +203,11 @@ 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
const chartHeight = {
tiny: 76,
small: 96,
normal: 160,
}[chartSize as string] as number
return (
<Loading active={!data}>
@@ -293,7 +297,7 @@ export function BarChart({
)}
</>
) : (
<NoData title={noDataTitle} message={noDataMessage}/>
<NoData title={noDataTitle} message={noDataMessage} />
)}
</div>
</div>