Skip to content

Commit

Permalink
Make RouteList scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
jvaclavik committed Oct 11, 2023
1 parent 37ed551 commit 969979b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/components/FeaturePanel/Climbing/ClimbingPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { PanelScrollbars, PanelWrapper } from '../../utils/PanelHelpers';

const EditRoutesContainer = styled.div`
padding: 10px;
overflow: auto;
`;

export const ClimbingPanel = () => {
Expand Down
3 changes: 3 additions & 0 deletions src/components/FeaturePanel/Climbing/ClimbingView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ type Props = {

const Container = styled.div`
position: relative;
display: flex;
flex-direction: column;
height: 100%;
`;
const StickyContainer = styled.div<{ imageHeight: number }>`
position: relative;
Expand Down
8 changes: 4 additions & 4 deletions src/components/FeaturePanel/Climbing/Guide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ export const Guide = () => {
useClimbingContext();

return (
<GuideContainer>
{isSelectedRouteEditable && (
isSelectedRouteEditable && (
<GuideContainer>
<Alert severity="info" variant="filled">
{routes[routeSelectedIndex].path.length === 0
? t('climbingpanel.create_first_node')
: t('climbingpanel.create_next_node')}
</Alert>
)}
</GuideContainer>
</GuideContainer>
)
);
};
9 changes: 7 additions & 2 deletions src/components/FeaturePanel/Climbing/RouteList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ type Props = {
onDeleteExistingRouteClick: (deletedExistingRouteIndex: number) => void;
isReadOnly: boolean;
};
const Container = styled.div`
flex: 1;
overflow: auto;
`;

const EmptyValue = styled.div`
color: #666;
`;
Expand Down Expand Up @@ -159,7 +164,7 @@ export const RouteList = ({
if (isReadOnly && routes.length === 0) return null;

return (
<div>
<Container>
<TableContainer>
<Table size="small">
{!isReadOnly && (
Expand Down Expand Up @@ -203,6 +208,6 @@ export const RouteList = ({
</TableBody>
</Table>
</TableContainer>
</div>
</Container>
);
};

0 comments on commit 969979b

Please sign in to comment.