Skip to content

Commit

Permalink
update style
Browse files Browse the repository at this point in the history
  • Loading branch information
tizayi committed May 20, 2024
1 parent c96dbf8 commit ded1b05
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 20 deletions.
2 changes: 2 additions & 0 deletions src/data-entry/beamProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
InputLabel,
SelectChangeEvent,
InputAdornment,
Divider,
} from "@mui/material";
import {
AngleUnits,
Expand Down Expand Up @@ -83,6 +84,7 @@ export default function BeampropertiesDataEntry() {
return (
<Stack spacing={2}>
<Typography variant="h6">Beam properties</Typography>
<Divider/>
{/* ENERGY */}
<Stack direction={"row"} spacing={1}>
<TextField
Expand Down
2 changes: 2 additions & 0 deletions src/data-entry/beamstop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
Button,
TextField,
InputAdornment,
Divider,
} from "@mui/material";
import { LengthUnits } from "../utils/units";
import { useBeamstopStore } from "./beamstopStore";
Expand Down Expand Up @@ -53,6 +54,7 @@ export default function BeamStopDataEntry(): JSX.Element {
return (
<Stack spacing={1}>
<Typography variant="h6"> Beamstop </Typography>
<Divider/>
<Stack direction={"row"} alignItems={"center"}>
{/* Diameter */}
<Typography flexGrow={1}>
Expand Down
2 changes: 2 additions & 0 deletions src/data-entry/cameraTube.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Divider,
FormControl,
InputAdornment,
InputLabel,
Expand Down Expand Up @@ -31,6 +32,7 @@ export default function CameraTubeDataEntry(): JSX.Element {
return (
<Stack spacing={1}>
<Typography variant="h6"> CameraTube </Typography>
<Divider/>
<Stack direction={"row"} alignItems={"center"}>
<Typography flexGrow={1}>
{" "}
Expand Down
30 changes: 19 additions & 11 deletions src/data-entry/dataSideBar.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import {
Card,
CardContent,
Stack,
Typography,
Divider,
Autocomplete,
TextField,
FormControl,
Select,
MenuItem,
InputLabel,
Button,
Divider,
} from "@mui/material";
import { LengthUnits } from "../utils/units";
import BeamStopDataEntry from "./beamstop";
Expand Down Expand Up @@ -72,10 +71,12 @@ export default function DataSideBar(): JSX.Element {
};

return (
<Card sx={{ maxHeight: "92vh", overflow: "scroll"}}>
<CardContent>
<Stack sx={{ maxHeight: "92vh", overflow: "scroll"}}>
<Stack spacing={1}>
<Card sx={{ p:2}} variant="outlined">
<Stack spacing={1}>
<Typography variant="h6">Beamline</Typography>
<Divider/>
<Stack direction={"row"} spacing={1}>
<Autocomplete
size="small"
Expand All @@ -100,8 +101,12 @@ export default function DataSideBar(): JSX.Element {
handleOpen={handleClickOpenPreset}
/>
</Stack>
<Divider />
</Stack>
</Card>
<Card sx={{ p:2}} variant="outlined">
<Stack spacing={1}>
<Typography variant="h6">Detector</Typography>
<Divider/>
<Stack direction={"row"} spacing={1}>
<Autocomplete
size="small"
Expand All @@ -125,7 +130,6 @@ export default function DataSideBar(): JSX.Element {
handleOpen={handleClickOpenDetector}
/>
</Stack>

<Typography>
Resolution (hxw): {detectorStore.detector.resolution.height} x{" "}
{detectorStore.detector.resolution.width}
Expand Down Expand Up @@ -158,14 +162,18 @@ export default function DataSideBar(): JSX.Element {
</Select>
</FormControl>
</Stack>
<Divider />
</Stack>
</Card>
<Card sx={{p:2}} variant="outlined">
<BeamStopDataEntry />
<Divider />
</Card>
<Card sx={{ p:2}} variant="outlined">
<CameraTubeDataEntry />
<Divider />
</Card>
<Card sx={{p:2}} variant="outlined">
<BeampropertiesDataEntry />
</Card>
</Stack>
</CardContent>
</Card>
</Stack>
);
}
3 changes: 3 additions & 0 deletions src/dialogs/BeamlineTable.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Paper } from "@mui/material";
import { useBeamlineConfigStore } from "../data-entry/beamlineconfigStore";
import { AppBeamline } from "../utils/types";
import { DataGrid, GridColDef, GridToolbar } from "@mui/x-data-grid";
Expand Down Expand Up @@ -59,6 +60,7 @@ export default function BeamlineTable() {
];

return (
<Paper>
<DataGrid
autoHeight
rows={displayArray}
Expand All @@ -68,5 +70,6 @@ export default function BeamlineTable() {
sx={{ border: 0 }}
disableSelectionOnClick
/>
</Paper>
);
}
4 changes: 1 addition & 3 deletions src/dialogs/beamlineDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
DialogActions,
DialogContent,
DialogTitle,
Divider,
Grid,
InputAdornment,
Stack,
Expand All @@ -19,7 +18,7 @@ import { useBeamlineConfigStore } from "../data-entry/beamlineconfigStore";
import { createInternalBeamline } from "../presets/presetManager";
import { SubmitHandler, useForm } from "react-hook-form";

const GRID_ITEM_SIZE = 3;
const GRID_ITEM_SIZE = 12;
const INPUT_PRECISION = 0.000001;

interface BeamlineForm {
Expand Down Expand Up @@ -61,7 +60,6 @@ export default function PresetDialog(props: {
<DialogContent>
<Stack spacing={2}>
<BeamlineTable />
<Divider />
<Grid container spacing={2}>
<Grid item xs={GRID_ITEM_SIZE}>
<TextField
Expand Down
1 change: 1 addition & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ body {
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background-color: white;
}

code {
Expand Down
2 changes: 1 addition & 1 deletion src/plot/centrePlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default function CentrePlot(): JSX.Element {
return (
<Stack direction="column" spacing={1}>
<Stack direction="row" spacing={1}>
<Card>
<Card variant="outlined">
<CardContent>
<div
style={{
Expand Down
2 changes: 1 addition & 1 deletion src/plot/legendBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default function LegendBar(): JSX.Element {
const plotConfig = usePlotStore();

return (
<Card sx={{flexGrow: 1}}>
<Card sx={{flexGrow: 1}} variant="outlined">
<CardContent>
<Stack spacing={1}>
<Typography variant="h6"> Legend</Typography>
Expand Down
6 changes: 4 additions & 2 deletions src/results/rangeTable.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
Card,
FormControl,
InputLabel,
MenuItem,
Paper,
Select,
SelectChangeEvent,
Table,
Expand Down Expand Up @@ -47,7 +47,8 @@ export default function RangeTable(props: { qRange: UnitRange }): JSX.Element {
.to(resultsStore.dUnits as string);

return (
<TableContainer component={Paper} sx={{ maxWidth: "30vw"}}>
<Card variant="outlined" sx={{ maxWidth: "30vw"}}>
<TableContainer >
<Table sx={{ minWidth: 50 }} aria-label="simple table" size="small">
{/* TABLE HEAD */}
<TableHead>
Expand Down Expand Up @@ -163,5 +164,6 @@ export default function RangeTable(props: { qRange: UnitRange }): JSX.Element {
</TableRow>
</Table>
</TableContainer>
</Card>
);
}
6 changes: 4 additions & 2 deletions src/results/resultsBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,12 @@ export default function ResultsBar({

const units = displayUnits(textBoxUnits);
return (
<Card sx={{
<Card variant="outlined" sx={{
height: 1 ,
maxHeight: "27vh",
overflow: "scroll", flexGrow: 1,}}>
overflow: "scroll",
flexGrow: 1
}}>
<CardContent>
<Stack spacing={1}>
<Typography variant="h6"> Results</Typography>
Expand Down

0 comments on commit ded1b05

Please sign in to comment.