Skip to content

Commit 0bc8ee6

Browse files
minORCray-oxd
authored andcommitted
DBC22-5022: Update mobile panels default open state
1 parent 412a0ce commit 0bc8ee6

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/frontend/src/Components/map/Map.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ export default function DriveBCMap(props) {
233233
};
234234

235235
// Use a ref to persist the snap point across renders
236-
const snapPointRef = useRef('25%');
237-
const [snap, setSnap] = useState('25%');
236+
const snapPointRef = useRef('50%');
237+
const [snap, setSnap] = useState('50%');
238238

239239
// Update both state and ref when snap changes
240240
const handleSnapChange = useCallback((newSnap) => {
@@ -277,8 +277,8 @@ export default function DriveBCMap(props) {
277277
setSnap(snapPointRef.current);
278278
} else if (!openPanel) {
279279
// Reset to default when drawer is completely dismissed
280-
snapPointRef.current = '25%';
281-
setSnap('25%');
280+
snapPointRef.current = '50%';
281+
setSnap('50%');
282282
}
283283
}, [openPanel, largeScreen]);
284284

src/frontend/src/Components/report/ReportMap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ export function ReportMap(props) {
179179
const [expanded, setExpanded] = useState(false);
180180

181181
// Drawer state
182-
const snapPointRef = useRef('25%');
183-
const [snap, setSnap] = useState('25%');
182+
const snapPointRef = useRef('50%');
183+
const [snap, setSnap] = useState('50%');
184184

185185
const handleSnapChange = (newSnap) => {
186186
snapPointRef.current = newSnap;
@@ -194,8 +194,8 @@ export function ReportMap(props) {
194194
if (activeFeature && !largeScreen) {
195195
setSnap(snapPointRef.current);
196196
} else if (!activeFeature) {
197-
snapPointRef.current = '25%';
198-
setSnap('25%');
197+
snapPointRef.current = '50%';
198+
setSnap('50%');
199199
}
200200
}, [activeFeature, largeScreen]);
201201

0 commit comments

Comments
 (0)