From 9a165749485ab3724ecc31198211bb98bbea7209 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 30 Jun 2023 13:10:08 -0700 Subject: [PATCH] Update table field components The structure of TableField's image props have changed --- components/common/SliderTableField/index.tsx | 18 ++++++++++-------- components/common/SwitchTableField/index.tsx | 16 ++++++++-------- components/common/TableField/index.module.scss | 4 ---- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/components/common/SliderTableField/index.tsx b/components/common/SliderTableField/index.tsx index 977de6cc..51d369ea 100644 --- a/components/common/SliderTableField/index.tsx +++ b/components/common/SliderTableField/index.tsx @@ -11,9 +11,11 @@ interface Props { description?: string value?: number className?: string - imageAlt?: string - imageClass?: string - imageSrc?: string[] + image?: { + className?: String + alt?: string + src: string[] + } min: number max: number step: number @@ -47,10 +49,8 @@ const SliderTableField = (props: Props) => { return ( { onValueCommit={handleValueCommit} /> ) diff --git a/components/common/SwitchTableField/index.tsx b/components/common/SwitchTableField/index.tsx index 27994939..e084eb83 100644 --- a/components/common/SwitchTableField/index.tsx +++ b/components/common/SwitchTableField/index.tsx @@ -13,9 +13,11 @@ interface Props extends React.HTMLAttributes { value?: boolean className?: string tabIndex?: number - imageAlt?: string - imageClass?: string - imageSrc?: string[] + image?: { + className?: String + alt?: string + src: string[] + } onValueChange: (value: boolean) => void } @@ -36,8 +38,8 @@ const SwitchTableField = (props: Props) => { const classes = classNames( { - SwitchTableField: true, - Disabled: props.disabled, + switch: true, + disabled: props.disabled, }, props.className ) @@ -47,9 +49,7 @@ const SwitchTableField = (props: Props) => { name={props.name} description={props.description} className={classes} - imageAlt={props.imageAlt} - imageClass={props.imageClass} - imageSrc={props.imageSrc} + image={props.image} label={props.label} > .input, &.numeric .right > .duration { text-align: right;