Fix: Session modal issues on mobile: scroll jumps to top on close, avatar overflow causes horizontal scroll. Closes #4358
This commit is contained in:
1 parent
952143ba5e
commit
22176eb76d
4 files changed
+13
-6
No files matched your search
@@ -17,7 +17,7 @@ export function SessionModal({ websiteId, ...props }: SessionModalProps) {
|
|||||||
const isSharePage = pathname.includes('/share/');
|
const isSharePage = pathname.includes('/share/');
|
||||||
const handleOpenChange = (isOpen: boolean) => {
|
const handleOpenChange = (isOpen: boolean) => {
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
router.push(updateParams({ session: undefined }));
|
router.replace(updateParams({ session: undefined }), { scroll: false });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
import { X } from 'lucide-react';
|
import { X } from 'lucide-react';
|
||||||
import { Avatar } from '@/components/common/Avatar';
|
import { Avatar } from '@/components/common/Avatar';
|
||||||
import { LoadingPanel } from '@/components/common/LoadingPanel';
|
import { LoadingPanel } from '@/components/common/LoadingPanel';
|
||||||
import { useMessages, useWebsiteSessionQuery } from '@/components/hooks';
|
import { useMessages, useMobile, useWebsiteSessionQuery } from '@/components/hooks';
|
||||||
import { SessionActivity } from './SessionActivity';
|
import { SessionActivity } from './SessionActivity';
|
||||||
import { SessionData } from './SessionData';
|
import { SessionData } from './SessionData';
|
||||||
import { SessionInfo } from './SessionInfo';
|
import { SessionInfo } from './SessionInfo';
|
||||||
@@ -33,6 +33,7 @@ export function SessionProfile({
|
|||||||
}) {
|
}) {
|
||||||
const { data, isLoading, error } = useWebsiteSessionQuery(websiteId, sessionId);
|
const { data, isLoading, error } = useWebsiteSessionQuery(websiteId, sessionId);
|
||||||
const { t, labels } = useMessages();
|
const { t, labels } = useMessages();
|
||||||
|
const { isMobile } = useMobile();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LoadingPanel
|
<LoadingPanel
|
||||||
@@ -54,9 +55,14 @@ export function SessionProfile({
|
|||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
<Column gap="6">
|
<Column gap="6">
|
||||||
<Row justifyContent="center" alignItems="center" gap="6">
|
<Row
|
||||||
<Avatar seed={data?.id} size={128} />
|
justifyContent="center"
|
||||||
<Column width="360px">
|
alignItems="center"
|
||||||
|
gap="6"
|
||||||
|
style={{ flexWrap: isMobile ? 'wrap' : 'nowrap' }}
|
||||||
|
>
|
||||||
|
<Avatar seed={data?.id} size={isMobile ? 80 : 128} />
|
||||||
|
<Column width={isMobile ? '100%' : '360px'} minWidth="0" maxWidth="360px">
|
||||||
<TextField label="ID" value={data?.id} allowCopy />
|
<TextField label="ID" value={data?.id} allowCopy />
|
||||||
</Column>
|
</Column>
|
||||||
</Row>
|
</Row>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export function SessionProfileModal({
|
|||||||
const query = Object.fromEntries(searchParams.entries());
|
const query = Object.fromEntries(searchParams.entries());
|
||||||
delete query.session;
|
delete query.session;
|
||||||
|
|
||||||
router.push(buildPath(`/websites/${websiteId}/sessions`, query));
|
router.replace(buildPath(`/websites/${websiteId}/sessions`, query), { scroll: false });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOpenChange = (isOpen: boolean) => {
|
const handleOpenChange = (isOpen: boolean) => {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export function SessionsTable({
|
|||||||
href={
|
href={
|
||||||
getSessionHref ? getSessionHref(row) : `/websites/${websiteId}/sessions/${row.id}`
|
getSessionHref ? getSessionHref(row) : `/websites/${websiteId}/sessions/${row.id}`
|
||||||
}
|
}
|
||||||
|
scroll={getSessionHref ? false : undefined}
|
||||||
>
|
>
|
||||||
<Avatar seed={row.id} size={32} />
|
<Avatar seed={row.id} size={32} />
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
Reference in new issue
Block a user