Skip to content

Commit

Permalink
fix DataControls in the bottom of the leftSideBar (#125)
Browse files Browse the repository at this point in the history
* fixed DataControls in the bottom of the leftSideBar, the rest is still scrollable

* lint fixes
  • Loading branch information
TeunHuijben authored Oct 8, 2024
1 parent 09a5793 commit 91ca28f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
24 changes: 19 additions & 5 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,15 @@ export default function App() {
{brandingLogoPath && brandingName && <Divider orientation="vertical" flexItem />}
{brandingName && <h2>{brandingName}</h2>}{" "}
</Box>
<Box flexGrow={0} padding="2em">

{/* Scrollable section for other controls */}
<Box
sx={{
flexGrow: 1, // CHANGED: Allows the middle section to expand
overflowY: "auto", // CHANGED: Makes this section scrollable
padding: "2em",
}}
>
<CellControls
clearTracks={() => {
dispatchCanvas({ type: ActionType.REMOVE_ALL_TRACKS });
Expand All @@ -354,9 +362,7 @@ export default function App() {
dispatchCanvas({ type: ActionType.SELECTION_MODE, selectionMode: value });
}}
/>
</Box>
<Divider />
<Box flexGrow={4} padding="2em">
<Divider sx={{ marginY: "1em" }} />
<LeftSidebarWrapper
hasTracks={numSelectedCells > 0}
trackManager={trackManager}
Expand All @@ -380,7 +386,15 @@ export default function App() {
/>
</Box>
<Divider />
<Box flexGrow={0} padding="1em">
<Box
sx={{
flexGrow: 0,
padding: "1em",
position: "sticky",
bottom: 0,
backgroundColor: "#fff",
}}
>
<DataControls
dataUrl={dataUrl}
initialDataUrl={initialViewerState.dataUrl}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CellControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default function CellControls(props: CellControlsProps) {
min={0.05}
max={1}
step={0.01}
valueLabelDisplay="on"
valueLabelDisplay="off"
valueLabelFormat={(value) => `${value}`}
onChange={(_, value) => {
props.setPointSize(value as number);
Expand Down
2 changes: 1 addition & 1 deletion src/components/leftSidebar/ControlInstructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function ControlInstructions(props: ControlInstructionsProps) {
break;
}
return (
<Callout title="Select Cells" intent="info" sx={{ width: "auto" }}>
<Callout intent="info" sx={{ width: "auto" }}>
{instructionText}
</Callout>
);
Expand Down

0 comments on commit 91ca28f

Please sign in to comment.