Skip to content

Commit d067fea

Browse files
committed
Don't prefetch all links on page
1 parent e7a5d93 commit d067fea

File tree

2 files changed

+26
-7
lines changed

2 files changed

+26
-7
lines changed

pages/_app.tsx

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function Toolbox({ Component, pageProps }: AppProps) {
8686
css={tw`text-white w-full md:px-8 p-2 md:h-14 flex flex-row text-white md:px-8 lg:px-12`}
8787
>
8888
<div css={tw`flex flex-col md:flex-row w-full`}>
89-
<Link href={"/"} passHref>
89+
<Link href={"/"} prefetch={false} passHref>
9090
<div css={tw`flex flex-row hover:cursor-pointer m-4 md:m-0`}>
9191
<div css={tw`my-auto`}>
9292
<FontAwesomeIcon icon={faToolbox} size={"2x"} />
@@ -123,7 +123,7 @@ function Toolbox({ Component, pageProps }: AppProps) {
123123
${!navOpen && tw`overflow-hidden md:overflow-visible`}
124124
`}
125125
>
126-
<Link href={"/"} passHref>
126+
<Link href={"/"} prefetch={false} passHref>
127127
<p
128128
css={tw`px-3 mx-2 py-2 my-auto md:ml-auto hover:cursor-pointer`}
129129
>
@@ -132,13 +132,18 @@ function Toolbox({ Component, pageProps }: AppProps) {
132132
</Link>
133133
<Link
134134
href={"https://www.spigotmc.org/members/helpchat.1491649/"}
135+
prefetch={false}
135136
passHref
136137
>
137138
<p css={tw`px-3 mx-2 py-2 my-auto hover:cursor-pointer`}>
138139
Spigot
139140
</p>
140141
</Link>
141-
<Link href={"https://github.com/HelpChat"} passHref>
142+
<Link
143+
href={"https://github.com/HelpChat"}
144+
prefetch={false}
145+
passHref
146+
>
142147
<p css={tw`px-3 mx-2 py-2 my-auto hover:cursor-pointer`}>
143148
Github
144149
</p>
@@ -167,7 +172,12 @@ function Toolbox({ Component, pageProps }: AppProps) {
167172
if (Array.isArray(Tools[key])) {
168173
(Tools[key] as ToolboxTool[]).forEach((tool) => {
169174
children.push(
170-
<Link href={tool.link} key={tool.short} passHref>
175+
<Link
176+
href={tool.link}
177+
prefetch={false}
178+
key={tool.short}
179+
passHref
180+
>
171181
<p
172182
css={tw`px-3 ml-2 pt-3 pb-1 hover:cursor-pointer hover:bg-gray-600`}
173183
>
@@ -184,7 +194,12 @@ function Toolbox({ Component, pageProps }: AppProps) {
184194
key1
185195
].forEach((tool) => {
186196
children.push(
187-
<Link href={tool.link} key={tool.short} passHref>
197+
<Link
198+
href={tool.link}
199+
prefetch={false}
200+
key={tool.short}
201+
passHref
202+
>
188203
<p
189204
css={tw`px-3 ml-3 pt-3 pb-1 hover:cursor-pointer hover:bg-gray-600`}
190205
>
@@ -219,7 +234,11 @@ function Toolbox({ Component, pageProps }: AppProps) {
219234
})}
220235
</div>
221236
</div>
222-
<Link href={"https://discord.gg/helpchat"} passHref>
237+
<Link
238+
href={"https://discord.gg/helpchat"}
239+
prefetch={false}
240+
passHref
241+
>
223242
<p
224243
css={tw`px-3 mx-2 py-2 my-auto hover:cursor-pointer hover:bg-gray-800 hover:text-white bg-white text-black rounded-md`}
225244
>

pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function ToolboxCard({
9494
link: string;
9595
}) {
9696
return (
97-
<Link href={link} passHref>
97+
<Link href={link} prefetch={false} passHref>
9898
<div
9999
css={tw`gap-0.5 p-3 rounded-2xl bg-white/10 hover:bg-white/20 text-white hover:cursor-pointer width[15rem] max-w-full break-words min-height[12rem] w-56 block grid grid-cols-1 place-items-center mix-blend-multiply`}
100100
>

0 commit comments

Comments
 (0)