sharePage hotfix

This commit is contained in:
Francis Cao
2026-03-31 13:20:46 -07:00
parent 9c8f7704df
commit 726ee586b0
3 changed files with 20 additions and 11 deletions
@@ -1,14 +1,22 @@
import { DataGrid } from '@/components/common/DataGrid';
import { useWebsiteSessionsQuery } from '@/components/hooks';
import { useNavigation, useWebsiteSessionsQuery } from '@/components/hooks';
import { SessionsTable } from './SessionsTable';
export function SessionsDataTable({ websiteId }: { websiteId: string }) {
const queryResult = useWebsiteSessionsQuery(websiteId);
const { pathname } = useNavigation();
const isSharePage = pathname.includes('/share/');
return (
<DataGrid query={queryResult} allowPaging allowSearch>
{({ data }) => {
return <SessionsTable data={data} websiteId={websiteId} />;
return (
<SessionsTable
data={data}
websiteId={websiteId}
getSessionHref={isSharePage ? () => undefined : undefined}
/>
);
}}
</DataGrid>
);
@@ -16,15 +16,16 @@ export function SessionsTable({
return (
<DataTable {...props}>
<DataColumn id="id" label={t(labels.session)} width="100px">
{(row: any) => (
<Link
href={
getSessionHref ? getSessionHref(row) : `/websites/${websiteId}/sessions/${row.id}`
}
>
{(row: any) => {
const href = getSessionHref ? getSessionHref(row) : `/websites/${websiteId}/sessions/${row.id}`;
return href ? (
<Link href={href}>
<Avatar seed={row.id} size={32} />
</Link>
) : (
<Avatar seed={row.id} size={32} />
</Link>
)}
);
}}
</DataColumn>
<DataColumn id="visits" label={t(labels.visits)} width="80px" />
<DataColumn id="views" label={t(labels.views)} width="80px" />
@@ -118,7 +118,7 @@ export function SharePage() {
<PageBody gap>
<WebsiteProvider websiteId={websiteId}>
<Column>
<WebsiteHeader showActions={false} />
<WebsiteHeader showActions={false} allowLink={false} />
<PageComponent websiteId={websiteId} />
</Column>
</WebsiteProvider>