Hide replays from share page

This commit is contained in:
Francis Cao
2026-03-31 13:43:03 -07:00
parent 163e46d1f1
commit 1d04a02fd8
2 changed files with 11 additions and 5 deletions
@@ -10,9 +10,11 @@ export interface SessionModalProps extends ModalProps {
export function SessionModal({ websiteId, ...props }: SessionModalProps) {
const {
router,
pathname,
query: { session },
updateParams,
} = useNavigation();
const isSharePage = pathname.includes('/share/');
const handleOpenChange = (isOpen: boolean) => {
if (!isOpen) {
router.push(updateParams({ session: undefined }));
@@ -32,7 +34,7 @@ export function SessionModal({ websiteId, ...props }: SessionModalProps) {
<Dialog variant="sheet" className="rounded-lg">
{({ close }) => (
<Column padding="10">
<SessionProfile websiteId={websiteId} sessionId={session} onClose={() => close()} />
<SessionProfile websiteId={websiteId} sessionId={session} showReplays={!isSharePage} onClose={() => close()} />
</Column>
)}
</Dialog>
@@ -23,10 +23,12 @@ import { SessionStats } from './SessionStats';
export function SessionProfile({
websiteId,
sessionId,
showReplays = true,
onClose,
}: {
websiteId: string;
sessionId: string;
showReplays?: boolean;
onClose?: () => void;
}) {
const { data, isLoading, error } = useWebsiteSessionQuery(websiteId, sessionId);
@@ -65,7 +67,7 @@ export function SessionProfile({
<TabList>
<Tab id="activity">{t(labels.activity)}</Tab>
<Tab id="properties">{t(labels.properties)}</Tab>
<Tab id="replays">{t(labels.replays)}</Tab>
{showReplays && <Tab id="replays">{t(labels.replays)}</Tab>}
</TabList>
<TabPanel id="activity">
<SessionActivity
@@ -78,9 +80,11 @@ export function SessionProfile({
<TabPanel id="properties">
<SessionData sessionId={sessionId} websiteId={websiteId} />
</TabPanel>
<TabPanel id="replays">
<SessionReplaysDataTable websiteId={websiteId} sessionId={sessionId} />
</TabPanel>
{showReplays && (
<TabPanel id="replays">
<SessionReplaysDataTable websiteId={websiteId} sessionId={sessionId} />
</TabPanel>
)}
</Tabs>
</Column>
</Column>