Skip to content

Commit

Permalink
DBC22-1726: updated sidepanels in camera details page
Browse files Browse the repository at this point in the history
  • Loading branch information
minORC authored and fatbird committed Feb 21, 2024
1 parent 798d3ca commit 8e6ef50
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 47 deletions.
42 changes: 26 additions & 16 deletions src/frontend/src/Components/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ export default function MapWrapper({
const openPanel = !!(clickedCamera || clickedEvent || clickedFerry);

return (
<div className="map-container">
<div className={`map-container ${isPreview ? 'preview' : ''}`}>

<div
ref={panel} className={`side-panel ${openPanel ? 'open' : ''}`}
Expand Down Expand Up @@ -780,28 +780,20 @@ export default function MapWrapper({
</div>
)}

<Filters
toggleHandler={toggleLayer}
disableFeatures={isPreview}
enableRoadConditions={true}
/>
{!isPreview && (
<Filters
toggleHandler={toggleLayer}
disableFeatures={isPreview}
enableRoadConditions={true}
/>
)}
</div>

<div id="popup" className="ol-popup">
<div id="popup-content" className="ol-popup-content">
</div>
</div>

{isPreview && (
<Button
className="map-btn map-view"
variant="primary"
onClick={mapViewRoute}>
<FontAwesomeIcon icon={faUpRightAndDownLeftFromCenter} />
Map View
</Button>
)}

{isPreview && (
<Button
className="map-btn cam-location"
Expand All @@ -816,6 +808,24 @@ export default function MapWrapper({
</Button>
)}

{isPreview && (
<Button
className="map-btn map-view"
variant="primary"
onClick={mapViewRoute}>
<FontAwesomeIcon icon={faUpRightAndDownLeftFromCenter} />
Map View
</Button>
)}

{isPreview && (
<Filters
toggleHandler={toggleLayer}
disableFeatures={isPreview}
enableRoadConditions={true}
/>
)}

</div>
);
}
45 changes: 14 additions & 31 deletions src/frontend/src/Components/Map.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,6 @@
z-index: 5;
}

@keyframes open-panel {
from {
min-width: 0px;
@media (max-width: 767px) {
min-height: 0%;
}
}

to {
min-width: 500px;
@media (max-width: 767px) {
min-height: 50%;
}
}
}

@keyframes maximize-panel {
from {
@media (max-width: 767px) {
min-height: 50%;
}
}

to {
@media (max-width: 767px) {
min-height: 100%;
}
}
}

.map-wrap {
position: absolute;
top: 58px;
Expand All @@ -67,6 +37,20 @@
flex-direction: column;
}

&.preview {
flex-direction: column;

.side-panel {
transition: min-height 0.25s ease-in-out;
order: 2;

&.open {
min-width: 100%;
min-height: 100%;
}
}
}

.side-panel {
flex: 0;
min-width: 0px;
Expand All @@ -85,7 +69,6 @@

&.open {
min-width: 340px;
animation-name: open-panel;

.panel-content {
min-width: 340px;
Expand Down

0 comments on commit 8e6ef50

Please sign in to comment.