Skip to content

Commit d858cde

Browse files
cynthi8orangecms
authored andcommitted
fix: Export components with formStyles correctly
The Oscilloscope ChannelParameters and the Waveform SineWaveParameters have both a global style, and a local style they need to be exported with. The use of the withStyles function was previously incorrect, and as a result, neither style was getting applied.
1 parent 53150f3 commit d858cde

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/screen/Oscilloscope/components/ChannelParameters.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { options } from './settingOptions';
1616
import formStyles from '../../../utils/formStyles';
1717

1818
const styles = theme => ({
19+
...formStyles(theme),
1920
ch1ColorSwitchBase: {
2021
color: theme.palette.ch1Color,
2122
'&$colorChecked': {
@@ -289,6 +290,4 @@ class ChannelParameters extends Component {
289290
}
290291
}
291292

292-
export default withTheme(
293-
withStyles({ ...styles, ...formStyles })(ChannelParameters),
294-
);
293+
export default withTheme(withStyles(styles)(ChannelParameters));

src/screen/WaveGenerator/components/SineWaveParameters.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { options } from './settingOptions';
2222
import formStyles from '../../../utils/formStyles';
2323

2424
const styles = theme => ({
25+
...formStyles(theme),
2526
s1colorSwitchBase: {
2627
color: theme.palette.s1Color,
2728
'&$colorChecked': {
@@ -203,6 +204,4 @@ class SineWaveParameters extends Component {
203204
}
204205
}
205206

206-
export default withTheme(
207-
withStyles({ ...styles, ...formStyles })(SineWaveParameters),
208-
);
207+
export default withTheme(withStyles(styles)(ChannelParameters));

0 commit comments

Comments
 (0)