Skip to content

Commit

Permalink
Try turning off all Link prefetching
Browse files Browse the repository at this point in the history
  • Loading branch information
SSTPIERRE2 committed Mar 27, 2024
1 parent ef7a80e commit ef85dbe
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/web/components/Logo/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import clsx from 'clsx';

const Icon = () => {
return (
<Link href="/" className={styles.wrapper}>
<Link href="/" className={styles.wrapper} prefetch={false}>
<span className={clsx(styles.text, styles.accent)}>S</span>
<span className={clsx(styles.text, styles.primary)}>S</span>
<div className={clsx(styles.border, styles.bottomLeft)} />
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/Logo/Primary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import clsx from 'clsx';

const Logo = () => {
return (
<Link href="/" id="logo" className={styles.wrapper}>
<Link href="/" id="logo" className={styles.wrapper} prefetch={false}>
<span className={clsx(styles.text, styles.primary)}>Stephen</span>
<span className={clsx(styles.text, styles.accent)}>Stephen</span>
<div className={clsx(styles.wrapper, styles.lastNameWrapper)}>
Expand Down
1 change: 1 addition & 0 deletions packages/web/components/MobileMenu/MobileMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const MobileMenu = () => {
key={slug}
href={href}
onClick={() => toggleMobileMenu()}
prefetch={false}
>
{label}
</Link>
Expand Down
9 changes: 5 additions & 4 deletions packages/web/components/NavBar/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const NavBar = () => {
const underlineId = useId();

const handleClick = (
e: React.MouseEvent<HTMLAnchorElement> & { target: { id: slug } }
e: React.MouseEvent<HTMLAnchorElement> & { target: { id: slug } },
) => {
setHoveredLink(e.target.id);
};
Expand Down Expand Up @@ -53,11 +53,12 @@ const NavBar = () => {
data-text={label}
style={{
fontWeight:
pathName === href
? 'var(--font-weight-bold)'
: 'var(--font-weight-medium)',
pathName === href ?
'var(--font-weight-bold)'
: 'var(--font-weight-medium)',
}}
onMouseEnter={() => setHoveredLink(slug)}
prefetch={false}
>
{label}
</Link>
Expand Down
8 changes: 6 additions & 2 deletions packages/web/components/PostCard/PostCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const PostCard = ({
return (
<article className={styles.wrapper}>
<div className={styles.content}>
<Link href={`/blog/${slug}`}>
<Link href={`/blog/${slug}`} prefetch={false}>
<h2 className={styles.title}>{title}</h2>
</Link>

Expand All @@ -43,7 +43,11 @@ const PostCard = ({
))}
</div>
<p>{abstract}</p>
<Link href={`/blog/${slug}`} className={styles.readMore}>
<Link
href={`/blog/${slug}`}
className={styles.readMore}
prefetch={false}
>
Read more <VisuallyHidden>about this post</VisuallyHidden>
<ArrowRight className={styles.readMoreArrow} size="1.25rem" />
</Link>
Expand Down
1 change: 1 addition & 0 deletions packages/web/components/PrimaryLink/PrimaryLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const PrimaryLink: FC<Props & PropsWithChildren> = ({
className={clsx(styles.link, className)}
href={href}
title={title}
prefetch={false}
{...props}
>
{children}
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/SectionHeading/SectionHeading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const SectionHeading = ({ children }: HTMLAttributes<HTMLHeadingElement>) => {
return (
<h2 id={id} className={styles.heading}>
{children}
<Link href={`${path}#${id}`} className={styles.link}>
<Link href={`${path}#${id}`} className={styles.link} prefetch={false}>
<LinkIcon />
</Link>
</h2>
Expand Down
1 change: 1 addition & 0 deletions packages/web/components/SupportingLink/SupportingLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const SupportingLink: FC<Props & PropsWithChildren> = ({
<Link
className={clsx(styles.link, active && styles.active)}
href={href}
prefetch={false}
{...props}
>
{children}
Expand Down

0 comments on commit ef85dbe

Please sign in to comment.