Skip to content

Commit

Permalink
run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
tizayi committed Sep 6, 2023
1 parent f05e43b commit 723b1e6
Show file tree
Hide file tree
Showing 14 changed files with 493 additions and 324 deletions.
22 changes: 15 additions & 7 deletions src/basicAppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,24 @@ export default function BasicAppBar(): JSX.Element {

const preset = useBeamlineConfigStore((state) => state.preset);
const updateBeamstop = useBeamstopStore((state) => state.updateBeamstop);
const updateCameraTube = useCameraTubeStore((state) => state.updateCameraTube);
const updateBeamlineConfig = useBeamlineConfigStore((state) => state.updateBeamlineConfig);
const updateCameraTube = useCameraTubeStore(
(state) => state.updateCameraTube,
);
const updateBeamlineConfig = useBeamlineConfigStore(
(state) => state.updateBeamlineConfig,
);
const updatePreset = useBeamlineConfigStore((state) => state.updatePreset);
const updateDetector = useDetectorStore((state) => state.updateDetector);
const handlePreset = (preset: string) => {
const { beamstop, cameraTube, detector, ...beamlineConfig } = presetList[preset];
const { beamstop, cameraTube, detector, ...beamlineConfig } =
presetList[preset];
updateDetector(detector);
updateBeamstop(beamstop);
updateCameraTube(cameraTube);
updateBeamlineConfig(beamlineConfig);
updatePreset(preset)
updatePreset(preset);
};


return (
<Box sx={{ flexGrow: 2 }}>
<AppBar position="static">
Expand Down Expand Up @@ -73,9 +77,13 @@ export default function BasicAppBar(): JSX.Element {
id="combo-box-demo"
options={Object.keys(presetList)}
value={preset}
sx={{ width: 300 }}
sx={{ width: 300, color: "white" }}
renderInput={(params) => (
<TextField {...params} label="choose beamline preset" />
<TextField
{...params}
label="choose beamline preset"
sx={{ color: "white" }}
/>
)}
onChange={(_, value) => {
value ? handlePreset(value) : {};
Expand Down
Loading

0 comments on commit 723b1e6

Please sign in to comment.