mylink prefetch false by default

This commit is contained in:
Kalle (Sendou)
2020-12-12 15:29:10 +02:00
parent 4b19287b0f
commit 0858454a88
6 changed files with 13 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ const MyLink: React.FC<Props> = ({
children,
href,
isExternal,
prefetch = true,
prefetch = false,
isColored = true,
}) => {
const { themeColorShade } = useMyTheme();

View File

@@ -112,7 +112,6 @@ function LeagueMates({
? `/u/${mate.player.user.discordId}`
: `/player/${mate.player.switchAccountId}`
}
prefetch={false}
>
{mate.player.name ?? "???"}
</MyLink>

View File

@@ -117,7 +117,7 @@ function LeagueMate({
if (!mate.user && !mate.name) return <>{"???"}</>;
if (mate.user)
return (
<MyLink href={`/u/${mate.user.discordId}`} prefetch={false}>
<MyLink href={`/u/${mate.user.discordId}`}>
<Flex alignItems="center">
<UserAvatar user={mate.user} size="sm" mr={2} />
{mate.user.username}
@@ -125,11 +125,7 @@ function LeagueMate({
</MyLink>
);
return (
<MyLink href={`/player/${mate.switchAccountId}`} prefetch={false}>
{mate.name}
</MyLink>
);
return <MyLink href={`/player/${mate.switchAccountId}`}>{mate.name}</MyLink>;
}
export default TwinTable;

View File

@@ -64,10 +64,7 @@ const Top500Table: React.FC<Props> = ({ placements }) => {
)}
</TableCell>
<TableCell>
<MyLink
href={`/player/${placement.player.switchAccountId}`}
prefetch={false}
>
<MyLink href={`/player/${placement.player.switchAccountId}`}>
{placement.playerName}
</MyLink>
</TableCell>

View File

@@ -181,7 +181,10 @@ const AvatarWithInfo: React.FC<AvatarWithInfoProps> = ({
)}
<Box width="100%" textAlign="center" mt={4}>
{!!user.player?.switchAccountId && (
<MyLink href={`/player/${user.player?.switchAccountId}`}>
<MyLink
href={`/player/${user.player?.switchAccountId}`}
prefetch={true}
>
<Button leftIcon={<RiTrophyLine />} variant="outline">
<Trans>View results</Trans>
</Button>

View File

@@ -115,7 +115,11 @@ function UserInfo({ user }: { user: Unpacked<GetAllUsersData> }) {
</Link>
<Box ml={4}>
<Box fontWeight="bold">
<MyLink href={`/u/${user.discordId}`} isColored={false}>
<MyLink
href={`/u/${user.discordId}`}
isColored={false}
prefetch={true}
>
{user.username}#{user.discriminator}
</MyLink>
{user.profile?.country ? (