Skip to content

Commit

Permalink
rearrange uniform slider fields into a single row
Browse files Browse the repository at this point in the history
  • Loading branch information
davidar authored Apr 7, 2024
1 parent dd61612 commit 8d315cd
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions components/editor/uniformsliders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,26 @@ const UniformSlider = (props: UniformSliderProps) => {
setSliderUniform={setSliderUniform}
sliderRefMap={props.sliderRefMap}
/>
<TextField
label="Min"
type="number"
value={sliderMinRange}
sx={{
gridRow: '1',
width: '80px',
input: { color: getRainbowColor(props.index) },
label: { color: getRainbowColor(props.index) }
}}
InputLabelProps={{
shrink: true
}}
onChange={e => {
const val = +e.target.value;
if (val < sliderMaxRange) {
setSliderMinRange(val);
}
}}
/>
<Slider
aria-label={sliderUniform + ' slider'}
sx={{
Expand All @@ -250,30 +270,12 @@ const UniformSlider = (props: UniformSliderProps) => {
setSliderVal(newValue as number);
}}
/>
<TextField
label="Min"
type="number"
value={sliderMinRange}
sx={{
width: '80px',
input: { color: getRainbowColor(props.index) },
label: { color: getRainbowColor(props.index) }
}}
InputLabelProps={{
shrink: true
}}
onChange={e => {
const val = +e.target.value;
if (val < sliderMaxRange) {
setSliderMinRange(val);
}
}}
/>
<TextField
label="Max"
type="number"
value={sliderMaxRange}
sx={{
gridRow: '1',
width: '80px',
input: { color: getRainbowColor(props.index) },
label: { color: getRainbowColor(props.index) }
Expand Down

0 comments on commit 8d315cd

Please sign in to comment.