Skip to content

Commit

Permalink
fix: disable link prefetching in searchbar
Browse files Browse the repository at this point in the history
  • Loading branch information
martines3000 committed Jun 7, 2024
1 parent 3fdb02c commit d1e13f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/dapp/src/app/profile/[slug]/Feed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const Feed = ({ account, platform, tab, network }: FeedProps) => {
href={`?platform=${platform}&tab=dashboard`}
data-state={_tab === 'dashboard' ? 'active' : ''}
scroll={false}
prefetch={false}
>
Dashboard
</Link>
Expand All @@ -54,6 +55,7 @@ export const Feed = ({ account, platform, tab, network }: FeedProps) => {
className="cursor-pointer inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"
data-state={_tab === 'explorer' ? 'active' : ''}
scroll={false}
prefetch={false}
>
Endorsement Explorer 🚧
</Link>
Expand All @@ -62,6 +64,7 @@ export const Feed = ({ account, platform, tab, network }: FeedProps) => {
className="cursor-pointer inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"
data-state={_tab === 'graph' ? 'active' : ''}
scroll={false}
prefetch={false}
>
Social Graph 🚧
</Link>
Expand Down
2 changes: 2 additions & 0 deletions packages/dapp/src/app/profile/[slug]/ShareDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export function ShareDialog({
<TwitterIcon size={32} round />
</TwitterShareButton>
<Link
prefetch={false}
href={`https://hey.xyz/?text=${encodeURIComponent(
`Check out my profile on Endorse.fun!\n ${shareLink}\n`
)}&hashtags=${encodeURIComponent('Masca,Identity,Credential')}`}
Expand All @@ -80,6 +81,7 @@ export function ShareDialog({
/>
</Link>
<Link
prefetch={false}
href={`https://warpcast.com/~/compose?text=${encodeURIComponent(
'Check out my profile on Endorse.fun!'
)}&embeds[]=${shareLink}`}
Expand Down
5 changes: 5 additions & 0 deletions packages/dapp/src/components/Navbar/Searchbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const Searchbar = () => {
setShowDropdown(false);
setModalOpen(false);
}}
prefetch={false}
href={`/profile/${account.value}?platform=${account.platform}`}
className="w-full justify-start gap-x-2 hover:bg-gray-100 inline-flex items-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 h-9 px-4 py-2"
>
Expand All @@ -114,6 +115,7 @@ export const Searchbar = () => {
setShowDropdown(false);
setModalOpen(false);
}}
prefetch={false}
href={`/profile/${query}?platform=${PlatformType.ethereum}`}
className="w-full justify-start gap-x-2 hover:bg-gray-100 inline-flex items-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 h-9 px-4 py-2"
>
Expand All @@ -131,6 +133,7 @@ export const Searchbar = () => {
Results
</div>
<Link
prefetch={false}
onClick={() => {
setShowDropdown(false);
setModalOpen(false);
Expand All @@ -147,6 +150,7 @@ export const Searchbar = () => {
{query}.eth
</Link>
<Link
prefetch={false}
onClick={() => {
setShowDropdown(false);
setModalOpen(false);
Expand All @@ -163,6 +167,7 @@ export const Searchbar = () => {
{query}.lens
</Link>
<Link
prefetch={false}
onClick={() => {
setShowDropdown(false);
setModalOpen(false);
Expand Down

0 comments on commit d1e13f9

Please sign in to comment.