Skip to content

Commit

Permalink
feat: dynamic labels for the input field
Browse files Browse the repository at this point in the history
  • Loading branch information
pbullhove committed Apr 4, 2024
1 parent e5c8d56 commit b102654
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions web/src/Components/Bridging/InputContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ type InputContainerProps = {
bridgeValueHelperText: string
}

const InputLabels: { [key in BridgingOption]: string } = {
[BridgingOption.PERMEABILITY]: 'Permeability',
[BridgingOption.AVERAGE_PORESIZE]: 'Avg. Pore Size',
[BridgingOption.MAXIMUM_PORESIZE]: 'Max Pore Size',
[BridgingOption.CERAMIC_DISCS]: 'Disk Size',
}

const InputContainer = ({
mode,
onBridgeOptionChange,
Expand Down Expand Up @@ -77,11 +84,12 @@ const InputContainer = ({
<div style={{ width: '150px' }}>
{mode === BridgingOption.CERAMIC_DISCS ? (
<div style={{ display: 'flex', flexDirection: 'column' }}>
<label htmlFor='ceramic-disk-selector'>Ceramic Discs Size</label>
{/* <label htmlFor='ceramic-disk-selector'>Ceramic Discs Size</label> */}
<NativeSelect
onChange={event => onBridgeValueChange(event.target.value)}
id={'ceramic-disk-selector'}
label={''}
label={'Disk Size'}
meta={'microns'}
>
{CeramicDiscsValues.map((value, index) => {
return (
Expand All @@ -91,11 +99,11 @@ const InputContainer = ({
)
})}
</NativeSelect>
<small style={{ alignSelf: 'flex-end' }}>microns</small>
{/* <small style={{ alignSelf: 'flex-end' }}>microns</small> */}
</div>
) : (
<TextField
label='Value'
label={InputLabels[mode]}
type='number'
id='textfield-number'
meta={unit}
Expand Down

0 comments on commit b102654

Please sign in to comment.