do not prefetch

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-04-17 11:44:54 +02:00
committed by Carl-Gerhard Lindesvärd
parent 694f5bf622
commit 3a9fcf4915
13 changed files with 16 additions and 1 deletions

View File

@@ -68,6 +68,7 @@ export function ListReports({ reports }: ListReportsProps) {
return (
<div className="card" key={report.id}>
<Link
prefetch={false}
href={`/${params.organizationSlug}/${params.projectId}/reports/${report.id}`}
className="flex items-center justify-between border-b border-border p-4 leading-none [&_svg]:hover:opacity-100"
shallow

View File

@@ -65,6 +65,7 @@ export function ListDashboards({ dashboards }: ListDashboardsProps) {
<Card key={item.id} hover>
<div>
<Link
prefetch={false}
href={`/${organizationSlug}/${projectId}/dashboards/${item.id}`}
className="flex flex-col p-4"
>

View File

@@ -101,6 +101,7 @@ export function EventListItem(props: EventListItemProps) {
content={`${profile?.firstName} ${profile?.lastName}`}
>
<Link
prefetch={false}
onClick={(e) => {
e.stopPropagation();
}}

View File

@@ -39,6 +39,7 @@ function LinkWithIcon({
const active = overrideActive || href === pathname;
return (
<Link
prefetch={false}
className={cn(
'text-text flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium leading-none transition-all transition-colors hover:bg-slate-100',
active && 'bg-slate-100',

View File

@@ -55,7 +55,7 @@ export function LayoutSidebar({
<Hamburger toggled={active} onToggle={setActive} size={20} />
</div>
<div className="flex h-16 shrink-0 items-center border-b border-border px-4">
<Link href="/">
<Link prefetch={false} href="/">
<Logo />
</Link>
</div>
@@ -68,6 +68,7 @@ export function LayoutSidebar({
<div className="h-8 w-full bg-gradient-to-t from-background to-background/0"></div>
<div className="flex flex-col gap-2 bg-background p-4 pt-0">
<Link
prefetch={false}
className={cn('flex gap-2', buttonVariants())}
href={`/${organizationSlug}/${projectId}/reports`}
>

View File

@@ -46,6 +46,7 @@ export function ProfileList({ data, count }: ProfileListProps) {
render(profile) {
return (
<Link
prefetch={false}
href={`/${organizationSlug}/${projectId}/profiles/${profile.id}`}
className="flex items-center gap-2 font-medium"
>

View File

@@ -44,6 +44,7 @@ export default async function ProfileTopServer({
render(profile) {
return (
<Link
prefetch={false}
href={`/${organizationSlug}/${projectId}/profiles/${profile.id}`}
className="flex items-center gap-2 font-medium"
>

View File

@@ -44,6 +44,7 @@ const Connect = ({ project }: Props) => {
<ButtonContainer>
<div />
<LinkButton
prefetch={false}
href={`/onboarding/${project.id}/verify`}
size="lg"
className="min-w-28 self-start"

View File

@@ -64,6 +64,7 @@ const Verify = ({ project, events }: Props) => {
/>
<ButtonContainer>
<LinkButton
prefetch={false}
href={`/onboarding/${project.id}/connect`}
size="lg"
className="min-w-28 self-start"
@@ -75,6 +76,7 @@ const Verify = ({ project, events }: Props) => {
<div className="flex items-center gap-8">
{!verified && (
<Link
prefetch={false}
href={`/${project.organizationSlug}/${project.id}`}
className="text-sm text-muted-foreground underline"
>
@@ -83,6 +85,7 @@ const Verify = ({ project, events }: Props) => {
)}
<LinkButton
prefetch={false}
href="/"
size="lg"
className={cn(

View File

@@ -9,6 +9,7 @@ const SkipOnboarding = () => {
if (!pathname.startsWith('/onboarding')) return null;
return (
<Link
prefetch={false}
href="/"
className="flex items-center gap-2 text-sm text-muted-foreground"
>

View File

@@ -47,6 +47,7 @@ export function OverviewShare({ data }: OverviewShareProps) {
{data?.public && (
<DropdownMenuItem asChild>
<Link
prefetch={false}
href={`${process.env.NEXT_PUBLIC_DASHBOARD_URL}/share/overview/${data.id}`}
>
<EyeIcon size={16} className="mr-2" />

View File

@@ -103,6 +103,7 @@ export interface LinkButtonProps
icon?: LucideIcon;
responsive?: boolean;
href: string;
prefetch?: boolean;
}
const LinkButton = React.forwardRef<

View File

@@ -39,6 +39,7 @@ const Footer = ({ framework }: Pick<Props, 'framework'>) => (
Close
</Button>
<LinkButton
prefetch={false}
target="_blank"
href={framework.href}
className="flex-1"