Skip to content

Commit ef3bbfe

Browse files
committed
chore(cv): hide Integration and Multiplicity in CmdBar for CV layout
1 parent 06c4e4a commit ef3bbfe

1 file changed

Lines changed: 34 additions & 27 deletions

File tree

src/components/cmd_bar/index.js

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import Wavelength from './r07_wavelength_btn';
2121
import Pecker from './07_pecker';
2222
import ChangeAxes from './r08_change_axes';
2323
import Detector from './r09_detector';
24+
import Format from '../../helpers/format';
2425

2526
const styles = () => (
2627
Object.assign(
@@ -33,36 +34,41 @@ const styles = () => (
3334
);
3435

3536
const CmdBar = ({
36-
classes, feature, hasEdit, forecast, operations, editorOnly, jcampIdx, hideThreshold,
37-
}) => (
38-
<div className={classes.card}>
39-
<Viewer editorOnly={editorOnly} />
40-
<Zoom />
41-
<Peak jcampIdx={jcampIdx} feature={feature} />
42-
<Pecker jcampIdx={jcampIdx} />
43-
<Integration />
44-
<Multiplicity />
45-
<UndoRedo />
46-
<Submit
47-
operations={operations}
48-
feature={feature}
49-
forecast={forecast}
50-
editorOnly={editorOnly}
51-
hideSwitch={false}
52-
disabled={false}
53-
/>
54-
{
55-
hideThreshold ? null : (<Threshold feature={feature} hasEdit={hasEdit} />)
56-
}
57-
<Layout feature={feature} hasEdit={hasEdit} />
58-
<Wavelength />
59-
<ChangeAxes />
60-
<Detector />
61-
</div>
62-
);
37+
classes, feature, hasEdit, forecast, operations, editorOnly, jcampIdx, hideThreshold, layoutSt,
38+
}) => {
39+
const isCvLayout = Format.isCyclicVoltaLayout(layoutSt);
40+
41+
return (
42+
<div className={classes.card}>
43+
<Viewer editorOnly={editorOnly} />
44+
<Zoom />
45+
<Peak jcampIdx={jcampIdx} feature={feature} />
46+
<Pecker jcampIdx={jcampIdx} />
47+
{isCvLayout ? null : <Integration />}
48+
{isCvLayout ? null : <Multiplicity />}
49+
<UndoRedo />
50+
<Submit
51+
operations={operations}
52+
feature={feature}
53+
forecast={forecast}
54+
editorOnly={editorOnly}
55+
hideSwitch={false}
56+
disabled={false}
57+
/>
58+
{
59+
hideThreshold ? null : (<Threshold feature={feature} hasEdit={hasEdit} />)
60+
}
61+
<Layout feature={feature} hasEdit={hasEdit} />
62+
<Wavelength />
63+
<ChangeAxes />
64+
<Detector />
65+
</div>
66+
);
67+
};
6368

6469
const mapStateToProps = (state, _) => ( // eslint-disable-line
6570
{
71+
layoutSt: state.layout,
6672
}
6773
);
6874

@@ -78,6 +84,7 @@ CmdBar.propTypes = {
7884
hasEdit: PropTypes.bool.isRequired,
7985
operations: PropTypes.array.isRequired,
8086
editorOnly: PropTypes.bool.isRequired,
87+
layoutSt: PropTypes.string.isRequired,
8188
jcampIdx: PropTypes.any,
8289
hideThreshold: PropTypes.bool,
8390
};

0 commit comments

Comments
 (0)