From 2627c0a0c30b18112ff9f5e32480f16dd3abcfb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Jur=C4=8Do?= <62913177+peterjurco@users.noreply.github.com> Date: Fri, 6 Dec 2024 16:33:50 +0100 Subject: [PATCH] Fix console errors (#516) * Use camelCase in SVG element prop names when they are used as react components * Add forgotten key prop * Do not pass incorrect props to input & textarea --- src/components/form/input.tsx | 10 +++++----- src/components/form/textarea.tsx | 6 +++--- src/components/icons/checkbox-radio.tsx | 2 +- src/components/layout/layout.tsx | 4 +++- src/components/menu/dashboard-icon.tsx | 2 +- src/components/menu/docs-icon.tsx | 6 +++--- src/components/menu/forum-icon.tsx | 6 +++--- src/components/menu/market-icon.tsx | 6 +++--- src/components/menu/proposals-icon.tsx | 4 ++-- src/components/menu/tracker-icon.tsx | 2 +- src/components/sign-in/disconnect-icon.tsx | 6 +++--- 11 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/components/form/input.tsx b/src/components/form/input.tsx index 3e919d5d..b5e40eab 100644 --- a/src/components/form/input.tsx +++ b/src/components/form/input.tsx @@ -14,7 +14,7 @@ type Props = { onChange: ChangeEventHandler; }; -const Input = ({ type = 'text', ...componentProps }: Props) => { +const Input = ({ type = 'text', helperText, error, ...inputProps }: Props) => { const CustomNumberInput = useCallback((props: any) => { return (
@@ -25,16 +25,16 @@ const Input = ({ type = 'text', ...componentProps }: Props) => { if (type === 'number') { return ( - - + + ); } return ( - +
- +
); diff --git a/src/components/form/textarea.tsx b/src/components/form/textarea.tsx index 77afa3cd..b2990d69 100644 --- a/src/components/form/textarea.tsx +++ b/src/components/form/textarea.tsx @@ -11,11 +11,11 @@ type Props = { onChange: ChangeEventHandler; }; -const Textarea = (props: Props) => { +const Textarea = ({ helperText, error, ...textAreaProps }: Props) => { return ( - +
-