Skip to content

Commit

Permalink
feat: more styling
Browse files Browse the repository at this point in the history
  • Loading branch information
pbullhove committed Apr 4, 2024
1 parent c1960d7 commit b038b8c
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 80 deletions.
179 changes: 100 additions & 79 deletions web/src/Components/Bridging/InputContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BridgingOption, CeramicDiscsValues } from '../../Enums'
import { findDValue } from '../../Utils'
import { GraphData } from '../../Types'
import { Variants } from '@equinor/eds-core-react/dist/types/components/types'
import { colors } from '../../colors'

type InputContainerProps = {
mode: BridgingOption
Expand Down Expand Up @@ -39,97 +40,117 @@ const InputContainer = ({
backgroundColor: 'white',
borderRadius: '0.5rem',
padding: '0.5rem',
marginBlockStart: '1rem',
}}
>
<InputWrapper>
<Typography variant='h3'>Bridging options</Typography>
<span>Bridging based on:</span>
<RadioWrapper>
<Radio
label='Permeability'
name='group'
value={BridgingOption.PERMEABILITY}
onChange={onBridgeOptionChange}
checked={mode === BridgingOption.PERMEABILITY}
/>
<Radio
label='Average pore size/crack opening'
name='group'
value={BridgingOption.AVERAGE_PORESIZE}
onChange={onBridgeOptionChange}
checked={mode === BridgingOption.AVERAGE_PORESIZE}
/>
<Tooltip
title={
'Max poresize/crack opening is the largest pore throat diameter or widest crack/aperture width (fracture width or screen slot opening)'
}
>
<div
style={{
width: '180px',
border: '1px solid rgb(220, 220, 220)',
borderRadius: '0.5rem',
backgroundColor: `${colors.background}`,
padding: '0.5rem',
}}
>
<Typography variant='h3'>Bridging options</Typography>
<span>Bridging based on:</span>
<RadioWrapper>
<Radio
label='Max pore size/crack opening'
label='Permeability'
name='group'
value={BridgingOption.MAXIMUM_PORESIZE}
value={BridgingOption.PERMEABILITY}
onChange={onBridgeOptionChange}
checked={mode === BridgingOption.MAXIMUM_PORESIZE}
checked={mode === BridgingOption.PERMEABILITY}
/>
</Tooltip>
<Radio
label='Ceramic Discs'
name='group'
value={BridgingOption.CERAMIC_DISCS}
onChange={onBridgeOptionChange}
checked={mode === BridgingOption.CERAMIC_DISCS}
/>
</RadioWrapper>
<div style={{ width: '150px' }}>
{mode === BridgingOption.CERAMIC_DISCS ? (
<div style={{ display: 'flex', flexDirection: 'column' }}>
{/* <label htmlFor='ceramic-disk-selector'>Ceramic Discs Size</label> */}
<NativeSelect
onChange={event => onBridgeValueChange(event.target.value)}
id={'ceramic-disk-selector'}
label={'Disk Size'}
meta={'microns'}
>
{CeramicDiscsValues.map((value, index) => {
return (
<option value={value} key={index + value}>
{value}
</option>
)
})}
</NativeSelect>
{/* <small style={{ alignSelf: 'flex-end' }}>microns</small> */}
</div>
) : (
<TextField
label={InputLabels[mode]}
type='number'
id='textfield-number'
meta={unit}
value={bridgeValue || 0}
onChange={event => onBridgeValueChange(event.target.value)}
variant={bridgeValueVariant}
helperText={bridgeValueHelperText}
<Radio
label='Average pore size/crack opening'
name='group'
value={BridgingOption.AVERAGE_PORESIZE}
onChange={onBridgeOptionChange}
checked={mode === BridgingOption.AVERAGE_PORESIZE}
/>
)}
<Tooltip
title={
'Max poresize/crack opening is the largest pore throat diameter or widest crack/aperture width (fracture width or screen slot opening)'
}
>
<Radio
label='Max pore size/crack opening'
name='group'
value={BridgingOption.MAXIMUM_PORESIZE}
onChange={onBridgeOptionChange}
checked={mode === BridgingOption.MAXIMUM_PORESIZE}
/>
</Tooltip>
<Radio
label='Ceramic Discs'
name='group'
value={BridgingOption.CERAMIC_DISCS}
onChange={onBridgeOptionChange}
checked={mode === BridgingOption.CERAMIC_DISCS}
/>
</RadioWrapper>
<div style={{ width: '100%', margin: 'auto' }}>
{mode === BridgingOption.CERAMIC_DISCS ? (
<div style={{ display: 'flex', flexDirection: 'column' }}>
{/* <label htmlFor='ceramic-disk-selector'>Ceramic Discs Size</label> */}
<NativeSelect
onChange={event => onBridgeValueChange(event.target.value)}
id={'ceramic-disk-selector'}
label={'Disk Size'}
meta={'microns'}
>
{CeramicDiscsValues.map((value, index) => {
return (
<option value={value} key={index + value}>
{value}
</option>
)
})}
</NativeSelect>
{/* <small style={{ alignSelf: 'flex-end' }}>microns</small> */}
</div>
) : (
<TextField
label={InputLabels[mode]}
type='number'
id='textfield-number'
meta={unit}
value={bridgeValue || 0}
onChange={event => onBridgeValueChange(event.target.value)}
variant={bridgeValueVariant}
helperText={bridgeValueHelperText}
/>
)}
</div>
</div>
</InputWrapper>
{optimalBridgeGraphData.length > 0 && (
<div style={{ marginBlockStart: '1rem' }}>
<div
style={{
marginBlockStart: '2rem',
width: '180px',
border: '1px solid rgb(220, 220, 220)',
borderRadius: '0.5rem',
backgroundColor: `${colors.background}`,
padding: '0.5rem',
}}
>
<Typography variant='h3'>Optimal Bridge:</Typography>
<p>
D10: {findDValue(optimalBridgeGraphData, 10, 'Bridge')}
{'\u00B5m'}
</p>
<p>
D50: {findDValue(optimalBridgeGraphData, 50, 'Bridge')}
{'\u00B5m'}
</p>
<p>
D90: {findDValue(optimalBridgeGraphData, 90, 'Bridge')}
{'\u00B5m'}
</p>
<div style={{ marginInlineStart: '0.5rem' }}>
<p>
D10: {findDValue(optimalBridgeGraphData, 10, 'Bridge')}
{'\u00B5m'}
</p>
<p>
D50: {findDValue(optimalBridgeGraphData, 50, 'Bridge')}
{'\u00B5m'}
</p>
<p>
D90: {findDValue(optimalBridgeGraphData, 90, 'Bridge')}
{'\u00B5m'}
</p>
</div>
</div>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/src/Components/MainBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default ({ products }: MainBodyProps): ReactElement => {
</MainComponentsWrapper>
<div style={{ backgroundColor: 'white', borderRadius: '0.5rem', padding: '0.5rem' }}>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div style={{ display: 'flex' }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<Typography variant={'h3'}>Blends</Typography>
<Icon style={{ cursor: 'pointer', paddingLeft: '5px' }} data={info_circle} />
</div>
Expand Down

0 comments on commit b038b8c

Please sign in to comment.