Skip to content

Commit 563c4c7

Browse files
committed
Dashboard: disable prefetch for footer links (#6756)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR refactors the `AppFooter` component in `app-footer.tsx` by introducing a new `footerLinks` array to manage footer link data and replaces individual `Link` components with a new `FooterLink` function to enhance maintainability and readability. ### Detailed summary - Added `footerLinks` array containing link objects with `href` and `label`. - Replaced individual `Link` components with a mapped `FooterLink` component. - Introduced `FooterLink` function to streamline link rendering and improve code clarity. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 32c91ab commit 563c4c7

File tree

1 file changed

+51
-49
lines changed

1 file changed

+51
-49
lines changed

apps/dashboard/src/@/components/blocks/app-footer.tsx

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,37 @@ type AppFooterProps = {
1515
containerClassName?: string;
1616
};
1717

18+
const footerLinks = [
19+
{
20+
href: "/home",
21+
label: "Home",
22+
},
23+
{
24+
href: "https://blog.thirdweb.com",
25+
label: "Blog",
26+
},
27+
{
28+
href: "https://portal.thirdweb.com/changelog",
29+
label: "Changelog",
30+
},
31+
{
32+
href: "https://feedback.thirdweb.com/",
33+
label: "Feedback",
34+
},
35+
{
36+
href: "https://thirdweb.com/privacy-policy",
37+
label: "Privacy Policy",
38+
},
39+
{
40+
href: "https://thirdweb.com/terms",
41+
label: "Terms of Service",
42+
},
43+
{
44+
href: "https://thirdweb.com/chainlist",
45+
label: "Chainlist",
46+
},
47+
];
48+
1849
export function AppFooter(props: AppFooterProps) {
1950
return (
2051
<footer
@@ -80,57 +111,28 @@ export function AppFooter(props: AppFooterProps) {
80111
</div>
81112
{/* bottom row */}
82113
<div className="grid grid-flow-col grid-cols-2 grid-rows-5 gap-2 md:flex md:flex-row md:justify-between">
83-
<Link
84-
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
85-
href="/home"
86-
>
87-
Home
88-
</Link>
89-
<Link
90-
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
91-
href="https://blog.thirdweb.com"
92-
target="_blank"
93-
>
94-
Blog
95-
</Link>
96-
<Link
97-
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
98-
href="https://portal.thirdweb.com/changelog"
99-
target="_blank"
100-
>
101-
Changelog
102-
</Link>
103-
<Link
104-
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
105-
href="https://feedback.thirdweb.com/"
106-
target="_blank"
107-
>
108-
Feedback
109-
</Link>
110-
<Link
111-
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
112-
href="https://thirdweb.com/privacy-policy"
113-
target="_blank"
114-
>
115-
Privacy Policy
116-
</Link>
117-
<Link
118-
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
119-
href="https://thirdweb.com/terms"
120-
target="_blank"
121-
>
122-
Terms of Service
123-
</Link>
124-
125-
<Link
126-
className="px-[10px] py-[6px] text-muted-foreground text-sm hover:underline"
127-
href="https://thirdweb.com/chainlist"
128-
target="_blank"
129-
>
130-
Chain List
131-
</Link>
114+
{footerLinks.map((link) => (
115+
<FooterLink key={link.href} {...link} />
116+
))}
132117
</div>
133118
</div>
134119
</footer>
135120
);
136121
}
122+
123+
function FooterLink(props: {
124+
href: string;
125+
label: string;
126+
prefetch?: boolean;
127+
}) {
128+
return (
129+
<Link
130+
href={props.href}
131+
prefetch={false}
132+
className="px-0 py-[6px] text-muted-foreground text-sm hover:underline"
133+
target="_blank"
134+
>
135+
{props.label}
136+
</Link>
137+
);
138+
}

0 commit comments

Comments
 (0)