From d14743c396d7aa1d5240f36578c3ced835096b7b Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Wed, 11 Nov 2020 22:41:47 -0800 Subject: [PATCH] Support centered and left-justified statistic views --- web/pages/components/statistic.tsx | 4 +++- web/pages/hardware-info.tsx | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web/pages/components/statistic.tsx b/web/pages/components/statistic.tsx index 45cca053e..64910e443 100644 --- a/web/pages/components/statistic.tsx +++ b/web/pages/components/statistic.tsx @@ -7,16 +7,18 @@ interface ItemProps { prefix: JSX.Element, color: string, progress?: boolean, + centered: boolean, }; export default function StatisticItem(props: ItemProps) { const { title, value, prefix } = props; const View = props.progress ? ProgressView : StatisticView; + const style = props.centered ? {display: 'flex', alignItems: 'center', justifyContent: 'center'} : {}; return ( -
+
diff --git a/web/pages/hardware-info.tsx b/web/pages/hardware-info.tsx index 122cc0671..8ae70a5df 100644 --- a/web/pages/hardware-info.tsx +++ b/web/pages/hardware-info.tsx @@ -81,6 +81,7 @@ const series = [ prefix={} color={series[0].color} progress + centered /> } color={series[1].color} progress + centered /> } color={series[2].color} progress + centered />