From 1f4493aaf93a4ff38f2038be43832cb01a992fa1 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 15 Aug 2022 17:49:15 -0700 Subject: [PATCH] Fix linter warnings --- web/components/config/form-textfield.tsx | 5 +++++ web/components/statistic.tsx | 19 ++++++++++++++++--- .../CustomPageContent/CustomPageContent.tsx | 1 + 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/web/components/config/form-textfield.tsx b/web/components/config/form-textfield.tsx index 29afc6ebfb..5e5a31bf1c 100644 --- a/web/components/config/form-textfield.tsx +++ b/web/components/config/form-textfield.tsx @@ -165,6 +165,11 @@ TextField.defaultProps = { tip: '', type: TEXTFIELD_TYPE_TEXT, value: '', + + pattern: '', + useTrim: false, + useTrimLead: false, + onSubmit: () => {}, onBlur: () => {}, onChange: () => {}, diff --git a/web/components/statistic.tsx b/web/components/statistic.tsx index a1e8875b8a..b12a1deba3 100644 --- a/web/components/statistic.tsx +++ b/web/components/statistic.tsx @@ -1,4 +1,5 @@ /* eslint-disable react/no-unused-prop-types */ +/* eslint-disable react/no-unstable-nested-components */ // TODO: This component should be cleaned up and usage should be re-examined. The types should be reconsidered as well. import { Typography, Statistic, Card, Progress } from 'antd'; @@ -26,9 +27,15 @@ const defaultProps = { formatter: null, }; -function ProgressView({ title, value, prefix, suffix, color }: StatisticItemProps) { - const endColor = value > 90 ? 'red' : color; - const content = ( +interface ContentProps { + prefix: string; + value: any; + suffix: string; + title: string; +} + +function Content({ prefix, value, suffix, title }: ContentProps) { + return (
{prefix}
@@ -42,6 +49,12 @@ function ProgressView({ title, value, prefix, suffix, color }: StatisticItemProp
); +} + +function ProgressView({ title, value, prefix, suffix, color }: StatisticItemProps) { + const endColor = value > 90 ? 'red' : color; + const content = ; + return (