Skip to content

Commit

Permalink
Merge branch 'fix/prefetch-export-link' into feature/migrate-api-route
Browse files Browse the repository at this point in the history
  • Loading branch information
cregourd committed Jun 26, 2024
2 parents a38014f + 47e93db commit 866e223
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-buses-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@premieroctet/next-admin": patch
---

Don't prefetch export Link in header
2 changes: 1 addition & 1 deletion packages/next-admin/src/components/ExportDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const ExportDropdown = ({ exports }: Props) => {
key={format}
className={clsx("cursor-pointer rounded-md px-2 py-1")}
>
<Link href={url} target="_blank">
<Link prefetch={false} href={url} target="_blank">
{t("list.row.actions.export", { format: format })}
</Link>
</DropdownItem>
Expand Down
3 changes: 1 addition & 2 deletions packages/next-admin/src/components/ListHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ type Props = {
title: string;
icon?: ModelIcon;
totalCount?: number;
canCreate?: boolean;
canDelete?: boolean;
};

export default function ListHeader({
Expand Down Expand Up @@ -147,6 +145,7 @@ export default function ListHeader({
<ExportDropdown exports={modelOptions?.list?.exports} />
) : (
<Link
prefetch={false}
href={modelOptions?.list?.exports.url}
target="_blank"
className="text-nextadmin-content-inverted dark:text-dark-nextadmin-brand-inverted border-nextadmin-border-default dark:border-dark-nextadmin-border-default dark:bg-dark-nextadmin-background-subtle flex min-w-fit items-center gap-x-2 rounded-md border bg-transparent px-3 py-2 text-sm"
Expand Down

0 comments on commit 866e223

Please sign in to comment.