From a6f4f07d9f3c7d81feb994da7908439e27060e2a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 2 May 2022 21:38:15 -0500 Subject: [PATCH] Streamfield: allow removing elements --- app/soapbox/components/ui/input/input.tsx | 6 ++++-- .../components/ui/streamfield/streamfield.tsx | 20 +++++++++++++++---- app/soapbox/features/edit_profile/index.tsx | 12 +++++++++-- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/app/soapbox/components/ui/input/input.tsx b/app/soapbox/components/ui/input/input.tsx index 67c32c3b9..14bbeb60d 100644 --- a/app/soapbox/components/ui/input/input.tsx +++ b/app/soapbox/components/ui/input/input.tsx @@ -18,6 +18,8 @@ interface IInput extends Pick, 'maxL defaultValue?: string, /** Extra class names for the element. */ className?: string, + /** Extra class names for the outer
element. */ + outerClassName?: string, /** URL to the svg icon. */ icon?: string, /** Internal input name. */ @@ -37,7 +39,7 @@ const Input = React.forwardRef( (props, ref) => { const intl = useIntl(); - const { type = 'text', icon, className, ...filteredProps } = props; + const { type = 'text', icon, className, outerClassName, ...filteredProps } = props; const [revealed, setRevealed] = React.useState(false); @@ -48,7 +50,7 @@ const Input = React.forwardRef( }, []); return ( -
+
{icon ? (