mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 17:26:24 +00:00
fix(journey): give the public gallery a definite width
Keep both centered content layouts from collapsing before Firefox loads gallery thumbnails. Closes #3296
This commit is contained in:
@@ -251,6 +251,21 @@ describe('JourneyPublicPage', () => {
|
||||
}
|
||||
});
|
||||
|
||||
it.each([
|
||||
['desktop', false],
|
||||
['mobile', true],
|
||||
] as const)('FE-PAGE-PUBLICJOURNEY-008b: gives the gallery frame a definite width on %s', async (_screen, isMobile) => {
|
||||
mockIsMobile.value = isMobile;
|
||||
setupSuccess();
|
||||
render(<JourneyPublicPage />);
|
||||
fireEvent.click(await screen.findByRole('button', { name: 'Gallery' }));
|
||||
|
||||
// An auto-width, centered flex item can shrink to the intrinsic width of
|
||||
// its lazy thumbnails before they have loaded.
|
||||
const tile = document.querySelector('button > img[src="/api/public/journey/test-share-token/photos/100/thumbnail"]');
|
||||
expect(tile?.closest('.mx-auto')?.classList.contains('w-full')).toBe(true);
|
||||
});
|
||||
|
||||
it('FE-PAGE-PUBLICJOURNEY-009: map is always visible in desktop two-column layout', async () => {
|
||||
setupSuccess();
|
||||
render(<JourneyPublicPage />);
|
||||
|
||||
@@ -649,7 +649,7 @@ function JourneyPublicContent() {
|
||||
{/* Content */}
|
||||
{desktopTwoColumn ? (
|
||||
// ── Desktop two-column: scrollable timeline feed + sticky map ──────────
|
||||
<div className="mx-auto flex max-w-[1440px]" style={{ alignItems: 'flex-start' }}>
|
||||
<div className="mx-auto flex w-full max-w-[1440px]" style={{ alignItems: 'flex-start' }}>
|
||||
{/* Left: feed */}
|
||||
<div ref={feedRef} className="min-w-0 flex-1 px-8 py-6 xl:max-w-[50%]">
|
||||
{view === 'timeline' && perms.share_timeline && renderTimeline()}
|
||||
@@ -709,7 +709,7 @@ function JourneyPublicContent() {
|
||||
</div>
|
||||
) : (
|
||||
// ── Single-column layout (mobile + desktop-without-map) ───────────────
|
||||
<div className="mx-auto max-w-[900px] px-4 py-6 md:px-8">
|
||||
<div className="mx-auto w-full max-w-[900px] px-4 py-6 md:px-8">
|
||||
{/* Floating view toggle — visible above the fullscreen map on mobile */}
|
||||
{isMobile && view === 'timeline' && perms.share_timeline && perms.share_map && availableViews.length > 1 && (
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user