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) { export function SessionModal({ websiteId, ...props }: SessionModalProps) {
const { const {
router, router,
pathname,
query: { session }, query: { session },
updateParams, updateParams,
} = useNavigation(); } = useNavigation();
const isSharePage = pathname.includes('/share/');
const handleOpenChange = (isOpen: boolean) => { const handleOpenChange = (isOpen: boolean) => {
if (!isOpen) { if (!isOpen) {
router.push(updateParams({ session: undefined })); router.push(updateParams({ session: undefined }));
@@ -32,7 +34,7 @@ export function SessionModal({ websiteId, ...props }: SessionModalProps) {
<Dialog variant="sheet" className="rounded-lg"> <Dialog variant="sheet" className="rounded-lg">
{({ close }) => ( {({ close }) => (
<Column padding="10"> <Column padding="10">
<SessionProfile websiteId={websiteId} sessionId={session} onClose={() => close()} /> <SessionProfile websiteId={websiteId} sessionId={session} showReplays={!isSharePage} onClose={() => close()} />
</Column> </Column>
)} )}
</Dialog> </Dialog>
@@ -23,10 +23,12 @@ import { SessionStats } from './SessionStats';
export function SessionProfile({ export function SessionProfile({
websiteId, websiteId,
sessionId, sessionId,
showReplays = true,
onClose, onClose,
}: { }: {
websiteId: string; websiteId: string;
sessionId: string; sessionId: string;
showReplays?: boolean;
onClose?: () => void; onClose?: () => void;
}) { }) {
const { data, isLoading, error } = useWebsiteSessionQuery(websiteId, sessionId); const { data, isLoading, error } = useWebsiteSessionQuery(websiteId, sessionId);
@@ -65,7 +67,7 @@ export function SessionProfile({
<TabList> <TabList>
<Tab id="activity">{t(labels.activity)}</Tab> <Tab id="activity">{t(labels.activity)}</Tab>
<Tab id="properties">{t(labels.properties)}</Tab> <Tab id="properties">{t(labels.properties)}</Tab>
<Tab id="replays">{t(labels.replays)}</Tab> {showReplays && <Tab id="replays">{t(labels.replays)}</Tab>}
</TabList> </TabList>
<TabPanel id="activity"> <TabPanel id="activity">
<SessionActivity <SessionActivity
@@ -78,9 +80,11 @@ export function SessionProfile({
<TabPanel id="properties"> <TabPanel id="properties">
<SessionData sessionId={sessionId} websiteId={websiteId} /> <SessionData sessionId={sessionId} websiteId={websiteId} />
</TabPanel> </TabPanel>
<TabPanel id="replays"> {showReplays && (
<SessionReplaysDataTable websiteId={websiteId} sessionId={sessionId} /> <TabPanel id="replays">
</TabPanel> <SessionReplaysDataTable websiteId={websiteId} sessionId={sessionId} />
</TabPanel>
)}
</Tabs> </Tabs>
</Column> </Column>
</Column> </Column>