diff --git a/apps/blog/app/[param]/(user-profile)/communities/content.tsx b/apps/blog/app/[param]/(user-profile)/communities/content.tsx index 271bb5b7f62d0b4d2a67f7b45fa75295d00d571f..ce78c6ae4ba245317970f8ba48e6fd085640c6f0 100644 --- a/apps/blog/app/[param]/(user-profile)/communities/content.tsx +++ b/apps/blog/app/[param]/(user-profile)/communities/content.tsx @@ -7,7 +7,7 @@ import { useQuery } from '@tanstack/react-query'; import { getSubscriptions } from '@transaction/lib/bridge-api'; import { getHivebuzzBadges, getPeakdBadges } from '@transaction/lib/custom-api'; import { getUserAvatarUrl } from '@ui/lib/avatar-utils'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; const CommunityContent = ({ username }: { username: string }) => { const { t } = useTranslation('common_blog'); diff --git a/apps/blog/app/[param]/[p2]/[permlink]/content.tsx b/apps/blog/app/[param]/[p2]/[permlink]/content.tsx index e841ca25b8d104c9c8c0754bee64e16fed785833..171b2f707e3a77851c5f290de0dea2f7bc657b71 100644 --- a/apps/blog/app/[param]/[p2]/[permlink]/content.tsx +++ b/apps/blog/app/[param]/[p2]/[permlink]/content.tsx @@ -56,7 +56,7 @@ import { handleError } from '@ui/lib/handle-error'; import parseDate from '@ui/lib/parse-date'; import { Clock, Link2 } from 'lucide-react'; import moment from 'moment'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { useParams, usePathname, useRouter, useSearchParams } from 'next/navigation'; import { useEffect, useMemo, useState } from 'react'; import { CircleSpinner } from 'react-spinners-kit'; diff --git a/apps/blog/app/[param]/[p2]/[permlink]/page.tsx b/apps/blog/app/[param]/[p2]/[permlink]/page.tsx index 79756c563726a290ca12742dadc1b919d4920552..a4558d640e7ad85bbc9163bea1a6c3b1d395d653 100644 --- a/apps/blog/app/[param]/[p2]/[permlink]/page.tsx +++ b/apps/blog/app/[param]/[p2]/[permlink]/page.tsx @@ -44,7 +44,7 @@ const PostPage = async ({ if (community.startsWith('hive-')) { await queryClient.prefetchQuery({ - queryKey: ['communityData', community], + queryKey: ['community', community], queryFn: () => getCommunity(community, observer) }); await queryClient.prefetchQuery({ diff --git a/apps/blog/app/communities/content.tsx b/apps/blog/app/communities/content.tsx index 159646d5d9c1265c70b67f0f630c611ec49d5d7e..6415864a52ab5ea15d47721141db3b395400a728 100644 --- a/apps/blog/app/communities/content.tsx +++ b/apps/blog/app/communities/content.tsx @@ -8,7 +8,7 @@ import { Separator } from '@ui/components/separator'; import CommunitiesSelectFilter from '@/blog/features/communities-list/communities-select-filter'; import CommunitiesList from '@/blog/features/communities-list/communities-list'; import { useUserClient } from '@smart-signer/lib/auth/use-user-client'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import env from '@beam-australia/react-env'; import { getCommunities } from '@transaction/lib/bridge-api'; import { useTranslation } from '@/blog/i18n/client'; diff --git a/apps/blog/components/base-path-link.tsx b/apps/blog/components/base-path-link.tsx index 4b01b8f82e7e7f8bda891b4c42fdc57a965f71ff..b0a133781c07fa33f85d809cd580a37644adf595 100644 --- a/apps/blog/components/base-path-link.tsx +++ b/apps/blog/components/base-path-link.tsx @@ -1,3 +1,4 @@ +// eslint-disable-next-line no-restricted-imports -- This is a wrapper component that needs direct access to next/link import Link from 'next/link'; import { MouseEvent, ReactNode } from 'react'; diff --git a/apps/blog/components/custom-error.tsx b/apps/blog/components/custom-error.tsx index 630eb70ac18690cf34c93ce231ce2f538a89ea26..47d902973d39563e2fbef580e89799b4a0858578 100644 --- a/apps/blog/components/custom-error.tsx +++ b/apps/blog/components/custom-error.tsx @@ -1,5 +1,5 @@ import { FC } from 'react'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Icons } from '@ui/components/icons'; import { useTranslation } from '@/blog/i18n/client'; diff --git a/apps/blog/components/no-data-error.tsx b/apps/blog/components/no-data-error.tsx index d88726b42161c3515d523a3db95cd232e8f3be3e..f4509c7ec7d74afba934551ef76b35bd9aea8566 100644 --- a/apps/blog/components/no-data-error.tsx +++ b/apps/blog/components/no-data-error.tsx @@ -1,5 +1,5 @@ import { FC } from 'react'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Icons } from '@ui/components/icons'; import { Activity } from 'lucide-react'; diff --git a/apps/blog/components/rocket-chat-widget.tsx b/apps/blog/components/rocket-chat-widget.tsx index 2c5f08e8bfb2daf6a0c62bed9fb902a8d22824c9..24685cb5bf6bef0c3b936e29ce3ec21cf8fd7fc2 100644 --- a/apps/blog/components/rocket-chat-widget.tsx +++ b/apps/blog/components/rocket-chat-widget.tsx @@ -5,7 +5,7 @@ import { Drawer } from '@ui/components/drawer'; import { useState, useRef, useEffect } from 'react'; import { siteConfig } from '@ui/config/site'; import { LoginType } from '@smart-signer/types/common'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Button } from '@ui/components/button'; import { inIframe } from '@smart-signer/lib/utils'; import clsx from 'clsx'; diff --git a/apps/blog/features/account-lists/list-area.tsx b/apps/blog/features/account-lists/list-area.tsx index ab0186eff992157e982c94c3ac3c5c4d3fe99bb6..18d0ed37e202b44fa25520f331ddc6626382ebd9 100644 --- a/apps/blog/features/account-lists/list-area.tsx +++ b/apps/blog/features/account-lists/list-area.tsx @@ -1,6 +1,6 @@ import { Button } from '@ui/components/button'; import { Input } from '@ui/components/input'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@ui/components/accordion'; import clsx from 'clsx'; import { IFollowList } from '@transaction/lib/extended-hive.chain'; diff --git a/apps/blog/features/account-social/subscription-list-item.tsx b/apps/blog/features/account-social/subscription-list-item.tsx index b228df34097cb3d4a433c43de98051e5b517f761..7637a7c00458445af40f52e8dc7780f02f99cdb4 100644 --- a/apps/blog/features/account-social/subscription-list-item.tsx +++ b/apps/blog/features/account-social/subscription-list-item.tsx @@ -1,7 +1,7 @@ 'use client'; import { Badge } from '@hive/ui'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; const SubscriptionListItem = ({ community }: { community: string[] }) => { return ( diff --git a/apps/blog/features/activity-log/list-item.tsx b/apps/blog/features/activity-log/list-item.tsx index 7febcb3de65e3783b87086785f0ce98196f2560d..d8bc591d54acffe29644a9935e5b396522e729d2 100644 --- a/apps/blog/features/activity-log/list-item.tsx +++ b/apps/blog/features/activity-log/list-item.tsx @@ -6,7 +6,7 @@ import { Avatar, AvatarFallback, AvatarImage } from '@ui/components/avatar'; import { IAccountNotification } from '@transaction/lib/extended-hive.chain'; import { useUserClient } from '@smart-signer/lib/auth/use-user-client'; import { usePathname } from 'next/navigation'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; const usernamePattern = /\B@[a-z0-9.-]+/gi; diff --git a/apps/blog/features/communities-list/communities-list-item.tsx b/apps/blog/features/communities-list/communities-list-item.tsx index 5db6266dfc79c33ecb57f50e05d43bead93077c0..dc44209ceb66d7ba0a22df053954a0d9f518b98e 100644 --- a/apps/blog/features/communities-list/communities-list-item.tsx +++ b/apps/blog/features/communities-list/communities-list-item.tsx @@ -2,7 +2,7 @@ import { cn } from '@ui/lib/utils'; import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@hive/ui/components/card'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import BasePathLink from '@/blog/components/base-path-link'; import { Community } from '@transaction/lib/extended-hive.chain'; import { useTranslation } from '@/blog/i18n/client'; diff --git a/apps/blog/features/community-profile/sort-page.tsx b/apps/blog/features/community-profile/sort-page.tsx index e02aa69176d9a2614d3090b99510b98c25711476..cc05ece49bc15bc26ee41d52c27e2038ea65d6e9 100644 --- a/apps/blog/features/community-profile/sort-page.tsx +++ b/apps/blog/features/community-profile/sort-page.tsx @@ -26,18 +26,20 @@ const SortPage = async ({ const queryClient = getQueryClient(); try { const observer = getObserverFromCookies(); - await queryClient.prefetchQuery({ - queryKey: ['community', tag], - queryFn: async () => await getCommunity(tag, observer) - }); - await queryClient.prefetchQuery({ - queryKey: ['subscribers', tag], - queryFn: async () => await getSubscribers(tag) - }); - await queryClient.prefetchQuery({ - queryKey: ['AccountNotification', tag], - queryFn: async () => await getAccountNotifications(tag) - }); + if (tag.startsWith('hive-')) { + await queryClient.prefetchQuery({ + queryKey: ['community', tag], + queryFn: async () => await getCommunity(tag, observer) + }); + await queryClient.prefetchQuery({ + queryKey: ['subscribers', tag], + queryFn: async () => await getSubscribers(tag) + }); + await queryClient.prefetchQuery({ + queryKey: ['AccountNotification', tag], + queryFn: async () => await getAccountNotifications(tag) + }); + } await queryClient.prefetchInfiniteQuery({ queryKey: ['entriesInfinite', sort, tag], queryFn: async ({ pageParam }) => { diff --git a/apps/blog/features/layouts/account-posts/tabs.tsx b/apps/blog/features/layouts/account-posts/tabs.tsx index 4382f1b7be3bc8dbb6980a32782fd34774610caa..23e3dbba138ac7909aeff3585af9dd5c18523bd8 100644 --- a/apps/blog/features/layouts/account-posts/tabs.tsx +++ b/apps/blog/features/layouts/account-posts/tabs.tsx @@ -2,7 +2,7 @@ import { useTranslation } from '@/blog/i18n/client'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@ui/components/tabs'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { usePathname } from 'next/navigation'; import { ReactNode } from 'react'; diff --git a/apps/blog/features/layouts/communities-my-bar.tsx b/apps/blog/features/layouts/communities-my-bar.tsx index b5e928ba88e1c7bf72f4d9c2e5073ce8939880f2..9a6f2622b36e139ad807a874b28b7f4a5fece0a9 100644 --- a/apps/blog/features/layouts/communities-my-bar.tsx +++ b/apps/blog/features/layouts/communities-my-bar.tsx @@ -1,6 +1,6 @@ 'use client'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { cn } from '@ui/lib/utils'; import { Card, CardContent, CardTitle } from '@hive/ui/components/card'; import { useTranslation } from '@/blog/i18n/client'; diff --git a/apps/blog/features/layouts/community/communities-sidebar.tsx b/apps/blog/features/layouts/community/communities-sidebar.tsx index 43606717e4f16431053b352b8e43cd84c2f6888b..5e71c2f2fc082f8cf5f6bea911487fd0908baf73 100644 --- a/apps/blog/features/layouts/community/communities-sidebar.tsx +++ b/apps/blog/features/layouts/community/communities-sidebar.tsx @@ -1,6 +1,6 @@ 'use client'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { useQuery } from '@tanstack/react-query'; import { getCommunities } from '@transaction/lib/bridge-api'; import { cn } from '@ui/lib/utils'; diff --git a/apps/blog/features/layouts/community/new-post-button.tsx b/apps/blog/features/layouts/community/new-post-button.tsx index 745c7aedffa82003dd6b01d83b0e6f0f43c3f467..28185f52b75fca9af13293adbd4184c3be335660 100644 --- a/apps/blog/features/layouts/community/new-post-button.tsx +++ b/apps/blog/features/layouts/community/new-post-button.tsx @@ -1,6 +1,6 @@ import { useLocalStorage } from 'usehooks-ts'; import { Button } from '@ui/components'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { DEFAULT_PREFERENCES, Preferences } from '@/blog/lib/utils'; import { useUserClient } from '@smart-signer/lib/auth/use-user-client'; import { useTranslation } from '../../../i18n/client'; diff --git a/apps/blog/features/layouts/explore-hive.tsx b/apps/blog/features/layouts/explore-hive.tsx index b689730004497dbc2b5651661880857d99038f61..07c27c537aee1a86bce9e1ba53b354267dbd7855 100644 --- a/apps/blog/features/layouts/explore-hive.tsx +++ b/apps/blog/features/layouts/explore-hive.tsx @@ -1,7 +1,7 @@ import { cn } from '@ui/lib/utils'; import { Card, CardContent, CardHeader, CardTitle } from '@hive/ui/components/card'; import { FC } from 'react'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Icons } from '@ui/components/icons'; import env from '@beam-australia/react-env'; diff --git a/apps/blog/features/layouts/sidebar.tsx b/apps/blog/features/layouts/sidebar.tsx index 79d5519b5c2cb121137fc8be4d7ac485d8863a34..668ff397c094fbe4125d37035338ea656c0d2164 100644 --- a/apps/blog/features/layouts/sidebar.tsx +++ b/apps/blog/features/layouts/sidebar.tsx @@ -1,7 +1,7 @@ import { Button } from '@ui/components/button'; import { Icons } from '@ui/components/icons'; import { Sheet, SheetContent, SheetTrigger, SheetClose } from '@ui/components/sheet'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import BasePathLink from '../../components/base-path-link'; import { Separator } from '@ui/components/separator'; import { ReactNode } from 'react'; diff --git a/apps/blog/features/layouts/site-header/main-bar.tsx b/apps/blog/features/layouts/site-header/main-bar.tsx index 106ea270afa6b3a4990149ceef0be4b7633a88fd..8118b7733c945af095f5144f360c638011d9448e 100644 --- a/apps/blog/features/layouts/site-header/main-bar.tsx +++ b/apps/blog/features/layouts/site-header/main-bar.tsx @@ -4,7 +4,7 @@ import { Button } from '@ui/components/button'; import { Icons } from '@ui/components/icons'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@ui/components/tooltip'; import { siteConfig } from '@ui/config/site'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import React, { useState, FC, useEffect } from 'react'; import clsx from 'clsx'; import { useUserClient } from '@smart-signer/lib/auth/use-user-client'; diff --git a/apps/blog/features/layouts/site-header/main-nav.tsx b/apps/blog/features/layouts/site-header/main-nav.tsx index 4ae6cedbdec19632ab21fc63080ff909ebd0f8a4..db877e189ef87e418c32d8792ec70016b2d6bc6b 100644 --- a/apps/blog/features/layouts/site-header/main-nav.tsx +++ b/apps/blog/features/layouts/site-header/main-nav.tsx @@ -1,6 +1,6 @@ 'use client'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { usePathname } from 'next/navigation'; import { cn } from '@ui/lib/utils'; diff --git a/apps/blog/features/layouts/site-header/search-button.tsx b/apps/blog/features/layouts/site-header/search-button.tsx index c835bceaefd042f53641f630924e22e2733f5041..946a9bfd5af9e90783b4eab7970a6e5feac2d0d5 100644 --- a/apps/blog/features/layouts/site-header/search-button.tsx +++ b/apps/blog/features/layouts/site-header/search-button.tsx @@ -4,7 +4,7 @@ import { Button } from '@ui/components/button'; import { Icons } from '@ui/components/icons'; import TooltipContainer from '@ui/components/tooltip-container'; import { cn } from '@ui/lib/utils'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; const SearchButton = ({ aiTag, className }: { aiTag: boolean; className?: string }) => { return ( diff --git a/apps/blog/features/layouts/site-header/user-menu.tsx b/apps/blog/features/layouts/site-header/user-menu.tsx index 7def9e8d3e164cc3a85367d8ef87ba324bfe0777..5652ac914fd41e3c9d0f067f62e41883267c815b 100644 --- a/apps/blog/features/layouts/site-header/user-menu.tsx +++ b/apps/blog/features/layouts/site-header/user-menu.tsx @@ -9,7 +9,7 @@ import { } from '@ui/components/dropdown-menu'; import { ReactNode } from 'react'; import ModeToggle from '../mode-toggle'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import BasePathLink from '../../../components/base-path-link'; import { Icons } from '@ui/components/icons'; import { Button } from '@ui/components'; diff --git a/apps/blog/features/layouts/user-profile/list-item.tsx b/apps/blog/features/layouts/user-profile/list-item.tsx index ba8393082184b09a77f932934e076d4e897dbeb8..4e9e39dc5c4fc091d270ee812ca5a3f40308c0fc 100644 --- a/apps/blog/features/layouts/user-profile/list-item.tsx +++ b/apps/blog/features/layouts/user-profile/list-item.tsx @@ -1,7 +1,7 @@ 'use client'; import clsx from 'clsx'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; const ListItem = ({ href, currentTab, label }: { href: string; currentTab: boolean; label: string }) => { return ( diff --git a/apps/blog/features/layouts/user-profile/profile-layout.tsx b/apps/blog/features/layouts/user-profile/profile-layout.tsx index 2457fd611c2606f5e8955f9ccb578dd1de6b2584..6fb3fc56635db20a5ce9e5535881ae692a53b3a1 100644 --- a/apps/blog/features/layouts/user-profile/profile-layout.tsx +++ b/apps/blog/features/layouts/user-profile/profile-layout.tsx @@ -1,7 +1,7 @@ 'use client'; import React, { ReactNode, useEffect, useState } from 'react'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import clsx from 'clsx'; import BasePathLink from '@/blog/components/base-path-link'; import { useQuery } from '@tanstack/react-query'; diff --git a/apps/blog/features/list-of-posts/payout-hover-content.tsx b/apps/blog/features/list-of-posts/payout-hover-content.tsx index b5cfc465022104aeed30b3751db25dbe93022975..e15ae7fbc5c7728e35d1da1575a203056672893b 100644 --- a/apps/blog/features/list-of-posts/payout-hover-content.tsx +++ b/apps/blog/features/list-of-posts/payout-hover-content.tsx @@ -1,7 +1,7 @@ 'use client'; import { dateToRelative } from '@ui/lib/parse-date'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { amt, fmt } from '@/blog/lib/utils'; import { useQuery } from '@tanstack/react-query'; import Big from 'big.js'; diff --git a/apps/blog/features/list-of-posts/post-card-comment-tooltip.tsx b/apps/blog/features/list-of-posts/post-card-comment-tooltip.tsx index ad7d94364f32ed76836884a40ad169358d653a35..d891b20880b60551728331adc67a7b01b72b638d 100644 --- a/apps/blog/features/list-of-posts/post-card-comment-tooltip.tsx +++ b/apps/blog/features/list-of-posts/post-card-comment-tooltip.tsx @@ -3,7 +3,7 @@ import { Icons } from '@ui/components/icons'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@ui/components/tooltip'; import { useTranslation } from '@/blog/i18n/client'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; interface PostCardCommentTooltipProps { comments: number; diff --git a/apps/blog/features/list-of-posts/post-card-hidden.tsx b/apps/blog/features/list-of-posts/post-card-hidden.tsx index 0278699e73188f3a2b2c719285c441c75838786d..33c4fa9f781bfc889565f9fc08fe528bf94a9149 100644 --- a/apps/blog/features/list-of-posts/post-card-hidden.tsx +++ b/apps/blog/features/list-of-posts/post-card-hidden.tsx @@ -1,6 +1,6 @@ import { User } from '@smart-signer/types/common'; import { Badge } from '@ui/components'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { useEffect, useState } from 'react'; interface PostCardHiddenProps { diff --git a/apps/blog/features/list-of-posts/post-img.tsx b/apps/blog/features/list-of-posts/post-img.tsx index 3030f1ccc5a68c2ddefade6b6f4110c3fdc8bdaa..102b32eede7ad4636aa1fa67c105d271573e96e4 100644 --- a/apps/blog/features/list-of-posts/post-img.tsx +++ b/apps/blog/features/list-of-posts/post-img.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'; import clsx from 'clsx'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { proxifyImageUrl } from '@ui/lib/old-profixy'; import { getDefaultImageUrl, getUserAvatarUrl } from '@ui/lib/avatar-utils'; import { customEndsWith } from '@/blog/lib/ends-with'; diff --git a/apps/blog/features/list-of-posts/post-list-item.tsx b/apps/blog/features/list-of-posts/post-list-item.tsx index c8d06715d363f37154fb27b8c4696b4353b52145..a1d03293c772946bc37b5d5492cf24094c27d993 100644 --- a/apps/blog/features/list-of-posts/post-list-item.tsx +++ b/apps/blog/features/list-of-posts/post-list-item.tsx @@ -1,7 +1,7 @@ 'use client'; import { useEffect, useState } from 'react'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@ui/components/tooltip'; import { Card, CardFooter, CardHeader } from '@ui/components/card'; import { Icons } from '@ui/components/icons'; @@ -62,18 +62,13 @@ const PostListItem = ({

{' '} - + {post.author} {' '} cross-posted{' '} @{post.original_entry.author}/{post.original_entry.permlink} @@ -88,7 +83,6 @@ const PostListItem = ({ href={`/@${post.reblogged_by[0]}`} className="cursor-pointer hover:text-destructive" data-testid="reblogged-author-link" - prefetch={false} > {post.reblogged_by[0]} {' '} @@ -99,7 +93,7 @@ const PostListItem = ({

{nsfw === 'show' && post.blacklists.length < 1 ? ( - +
{post.author} {' '} @@ -161,7 +154,6 @@ const PostListItem = ({ href={`/${post.category}/@${post.author}/${post.permlink}`} className="hover:cursor-pointer hover:text-destructive" data-testid="post-card-timestamp" - prefetch={false} > @@ -170,7 +162,7 @@ const PostListItem = ({ - + @@ -186,7 +178,6 @@ const PostListItem = ({ {t('cards.badges.pinned')} diff --git a/apps/blog/features/list-of-posts/summary.tsx b/apps/blog/features/list-of-posts/summary.tsx index b7fbef06ff6f55d25d8732d885de9a97197138f9..735ced3bdebbd1a81ec66e4fc72a3484684744db 100644 --- a/apps/blog/features/list-of-posts/summary.tsx +++ b/apps/blog/features/list-of-posts/summary.tsx @@ -8,7 +8,7 @@ import { Badge } from '@ui/components/badge'; import { CardContent, CardDescription, CardTitle } from '@ui/components/card'; import { Separator } from '@ui/components/separator'; import { useTranslation } from '@/blog/i18n/client'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; const PostSummary = ({ post, @@ -39,13 +39,12 @@ const PostSummary = ({ {post.title} - + {userFromDMCA ? t('cards.content_removed') : legalBlockedUser diff --git a/apps/blog/features/post-editor/advanced-settings-post-form.tsx b/apps/blog/features/post-editor/advanced-settings-post-form.tsx index e5b5e10a2a540af33c0b734986441da75eb3615e..95deb64bfa210c90d8258880f55b4c18c6893c48 100644 --- a/apps/blog/features/post-editor/advanced-settings-post-form.tsx +++ b/apps/blog/features/post-editor/advanced-settings-post-form.tsx @@ -11,7 +11,7 @@ import { DialogTrigger } from '@ui/components/dialog'; import { ReactNode, useEffect, useState } from 'react'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Icons } from '@ui/components/icons'; import { useLocalStorage } from 'usehooks-ts'; import { toast } from '@ui/components/hooks/use-toast'; diff --git a/apps/blog/features/post-editor/post-form.tsx b/apps/blog/features/post-editor/post-form.tsx index 37399fbe6d4986ef8c31333a9ee28a83f7216798..9c07b9db98b615ceaad358bfcaafc317b206f9be 100644 --- a/apps/blog/features/post-editor/post-form.tsx +++ b/apps/blog/features/post-editor/post-form.tsx @@ -1,7 +1,7 @@ 'use client'; import { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import clsx from 'clsx'; import * as z from 'zod'; import { Button } from '@hive/ui/components/button'; diff --git a/apps/blog/features/post-editor/reply-textbox.tsx b/apps/blog/features/post-editor/reply-textbox.tsx index ac646b37f7160610fe2d439147d323009d6e7559..510aee898846d25682c3b914992a55187a47f4eb 100644 --- a/apps/blog/features/post-editor/reply-textbox.tsx +++ b/apps/blog/features/post-editor/reply-textbox.tsx @@ -1,4 +1,4 @@ -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Button } from '@ui/components/button'; import { useEffect, useState, useRef } from 'react'; import { useTranslation } from '@/blog/i18n/client'; diff --git a/apps/blog/features/post-rendering/comment-list-item.tsx b/apps/blog/features/post-rendering/comment-list-item.tsx index ac02bcb7b437cb52656ca5aec127d9cf415c6112..eab3ef85ac1f92ccff0bcd5c1ef069271b91b14e 100644 --- a/apps/blog/features/post-rendering/comment-list-item.tsx +++ b/apps/blog/features/post-rendering/comment-list-item.tsx @@ -4,7 +4,7 @@ import { Icons } from '@hive/ui/components/icons'; import parseDate from '@hive/ui/lib/parse-date'; import { Card, CardContent, CardDescription, CardFooter, CardHeader } from '@hive/ui/components/card'; import { cn } from '@hive/ui/lib/utils'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Separator } from '@ui/components/separator'; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from '@ui/components/accordion'; import { useEffect, useRef, useState, type ReactNode } from 'react'; diff --git a/apps/blog/features/post-rendering/context-links.tsx b/apps/blog/features/post-rendering/context-links.tsx index c807da79aad81975246b8a0f8588be5d1f0730ab..976ace49fc5804a6811c1e9a0e738fae2a3ed472 100644 --- a/apps/blog/features/post-rendering/context-links.tsx +++ b/apps/blog/features/post-rendering/context-links.tsx @@ -1,6 +1,6 @@ import { useTranslation } from '@/blog/i18n/client'; import { Entry } from '@transaction/lib/extended-hive.chain'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; const ContentLinks = ({ data, noContext }: { data: Entry; noContext: boolean }) => { const { t } = useTranslation('common_blog'); diff --git a/apps/blog/features/post-rendering/leave-page-dialog.tsx b/apps/blog/features/post-rendering/leave-page-dialog.tsx index 9cf6250d3a8ef73aec81d1ea1208eaa8de71d457..69a4d124598102d82acc16f4cae07cd27f8b6153 100644 --- a/apps/blog/features/post-rendering/leave-page-dialog.tsx +++ b/apps/blog/features/post-rendering/leave-page-dialog.tsx @@ -1,6 +1,6 @@ import { Dialog, DialogContent } from '@ui/components/dialog'; import { Button, Separator } from '@ui/components'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { useTranslation } from '@/blog/i18n/client'; export function LeavePageDialog({ diff --git a/apps/blog/features/post-rendering/share-post-dialog.tsx b/apps/blog/features/post-rendering/share-post-dialog.tsx index 85f3e6c416a34813b3797729df55d03afc6780f4..6a302a7267725856db06277a9112e154975098f5 100644 --- a/apps/blog/features/post-rendering/share-post-dialog.tsx +++ b/apps/blog/features/post-rendering/share-post-dialog.tsx @@ -1,6 +1,6 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@ui/components/dialog'; import { ReactNode } from 'react'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import ClipboardCopy from './copy-from-input'; import { Icons } from '@ui/components/icons'; import { useTranslation } from '@/blog/i18n/client'; diff --git a/apps/blog/features/post-rendering/user-info.tsx b/apps/blog/features/post-rendering/user-info.tsx index a32d4118514da6b9fa5d04291a211612b3648653..a1988525a5d969000f2dc4398339810eab11b049 100644 --- a/apps/blog/features/post-rendering/user-info.tsx +++ b/apps/blog/features/post-rendering/user-info.tsx @@ -1,4 +1,4 @@ -import Link from 'next/link'; +import { Link } from '@hive/ui'; import parseDate from '@ui/lib/parse-date'; import { Badge } from '@ui/components/badge'; import { useTranslation } from '@/blog/i18n/client'; @@ -92,7 +92,7 @@ function UserInfo({ {authored ? ( Authored by{' '} - + @{authored} diff --git a/apps/blog/features/search/account-topic-result.tsx b/apps/blog/features/search/account-topic-result.tsx index 145416c425a7a65ff327796319105baced0d2797..30878b415acc939e0d27467e9955e221d396450e 100644 --- a/apps/blog/features/search/account-topic-result.tsx +++ b/apps/blog/features/search/account-topic-result.tsx @@ -6,7 +6,7 @@ import { useInView } from 'react-intersection-observer'; import { useUserClient } from '@smart-signer/lib/auth/use-user-client'; import Loading from '@ui/components/loading'; import { getByText } from '@transaction/lib/hive-api'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Activity } from 'lucide-react'; import { Preferences } from '@transaction/lib/app-types'; import PostCardSkeleton from '@hive/ui/components/card-skeleton'; diff --git a/apps/blog/features/suggestions-posts/card.tsx b/apps/blog/features/suggestions-posts/card.tsx index 8eb06df461e6ecd5081610d72ec86ef1315ff00e..73f22dadddefbed15d068448fea21f38e3766243 100644 --- a/apps/blog/features/suggestions-posts/card.tsx +++ b/apps/blog/features/suggestions-posts/card.tsx @@ -1,6 +1,6 @@ import { Entry } from '@transaction/lib/extended-hive.chain'; import { find_first_img } from '../list-of-posts/post-img'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { proxifyImageUrl } from '@ui/lib/old-profixy'; import { useState } from 'react'; import { getDefaultImageUrl } from '@hive/ui'; @@ -14,7 +14,7 @@ const SuggestionsCard = ({ entry }: { entry: Entry }) => { const [image, setImage] = useState(cardImage); return (
- + <> {image ? (
@@ -38,7 +38,7 @@ const SuggestionsCard = ({ entry }: { entry: Entry }) => {

{truncateTitle(entry.title)}

- {entry.author} + {entry.author}
diff --git a/apps/blog/lib/get-metadata.ts b/apps/blog/lib/get-metadata.ts index a60592073a208c68a6da5b16b6514b75d83326a4..8e4309d60c351d3606c0c298e298c7436b35bf63 100644 --- a/apps/blog/lib/get-metadata.ts +++ b/apps/blog/lib/get-metadata.ts @@ -52,7 +52,7 @@ export const getCommunityMetadata = async ( }; try { - if (secondParam === '') { + if (secondParam === '' || !secondParam.startsWith('hive-')) { const defaultMetadata = { tabTitle: '', description: '', diff --git a/apps/wallet/components/authorities-group-item.tsx b/apps/wallet/components/authorities-group-item.tsx index 975a8635419a538968a03fd2a4937607111d569d..7b738c63ef305a2a2e2c963f492034f9dc3366c1 100644 --- a/apps/wallet/components/authorities-group-item.tsx +++ b/apps/wallet/components/authorities-group-item.tsx @@ -4,7 +4,7 @@ import { FileKey, Trash, UserSquare } from 'lucide-react'; import { cutPublicKey } from '@/wallet/lib/utils'; import CopyToKeyboard from '@/wallet/components/copy-to-keyboard'; import { Input } from '@ui/components'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import ButtonTooltip from './button-tooltip'; import NumberInput from './number-input'; import { useTranslation } from 'next-i18next'; diff --git a/apps/wallet/components/common/profile-layout.tsx b/apps/wallet/components/common/profile-layout.tsx index b3c8629289783cfe3c2750d36b2e99c8a17a705d..9ced7a9db1895836bc3dd58de987262611093c39 100644 --- a/apps/wallet/components/common/profile-layout.tsx +++ b/apps/wallet/components/common/profile-layout.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { useRouter } from 'next/router'; import { useSiteParams } from '@ui/components/hooks/use-site-params'; import Loading from '@ui/components/loading'; diff --git a/apps/wallet/components/main-nav.tsx b/apps/wallet/components/main-nav.tsx index 0c1bbbc1fb6cad50193510606cfca55669baf4d9..157a6dea975d1f0360a0a296c8a953df7ac04fe9 100644 --- a/apps/wallet/components/main-nav.tsx +++ b/apps/wallet/components/main-nav.tsx @@ -1,4 +1,4 @@ -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { usePathname } from 'next/navigation'; import { cn } from '@ui/lib/utils'; diff --git a/apps/wallet/components/mobile-nav.tsx b/apps/wallet/components/mobile-nav.tsx index ad87d1402686874827da59d621d04d457956a443..f8b546e34c4eb8e3993753c838c8abfde597f177 100644 --- a/apps/wallet/components/mobile-nav.tsx +++ b/apps/wallet/components/mobile-nav.tsx @@ -1,7 +1,7 @@ 'use client'; import * as React from 'react'; -import Link, { LinkProps } from 'next/link'; +import { Link, LinkProps } from '@hive/ui'; import { useRouter } from 'next/navigation'; import { SidebarOpen } from 'lucide-react'; import { siteConfig } from '@ui/config/site'; diff --git a/apps/wallet/components/proposals-list-item.tsx b/apps/wallet/components/proposals-list-item.tsx index eaa7f95ce5c3eaa0441a70c1603eae504b951b61..789df4dfed64daae67561bbf27245cfec75aea72 100644 --- a/apps/wallet/components/proposals-list-item.tsx +++ b/apps/wallet/components/proposals-list-item.tsx @@ -1,4 +1,4 @@ -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { BURN_ACCOUNTS, REFUND_ACCOUNTS } from '@/wallet/lib/constants'; import { IListItemProps } from '@/wallet/lib/hive'; import { cn, getRoundedAbbreveration, numberWithCommas } from '@hive/ui/lib/utils'; diff --git a/apps/wallet/components/sidebar.tsx b/apps/wallet/components/sidebar.tsx index fadad2b02d4c37d80d57b12ce9f5f7ea57e0519f..357a5ea08b88664cbc6174f2aa28556ca0c03a41 100644 --- a/apps/wallet/components/sidebar.tsx +++ b/apps/wallet/components/sidebar.tsx @@ -1,7 +1,7 @@ import { Button } from '@ui/components/button'; import { Icons } from '@ui/components/icons'; import { Sheet, SheetContent, SheetTrigger, SheetClose } from '@ui/components/sheet'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Separator } from '@ui/components/separator'; import clsx from 'clsx'; import { ReactNode } from 'react'; diff --git a/apps/wallet/components/site-header.tsx b/apps/wallet/components/site-header.tsx index 658e5f13540226b8e60e71b117274a4dbc763717..067166277d2f0726b244ad01dcaac4edd1d25276 100644 --- a/apps/wallet/components/site-header.tsx +++ b/apps/wallet/components/site-header.tsx @@ -3,7 +3,7 @@ import { Icons } from '@ui/components/icons'; import { FC, useState, useEffect } from 'react'; import Sidebar from './sidebar'; import ModeToggle from './mode-toggle'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import DialogLogin from './dialog-login'; import LangToggle from '@/wallet/components/lang-toggle'; import { useTranslation } from 'next-i18next'; diff --git a/apps/wallet/components/user-menu.tsx b/apps/wallet/components/user-menu.tsx index 96f37c94784e4a83dc210fa0583e152a33c75ea6..c8f97ed95ae40f16ede2d39d1b898bde2317cc27 100644 --- a/apps/wallet/components/user-menu.tsx +++ b/apps/wallet/components/user-menu.tsx @@ -9,7 +9,7 @@ import { } from '@ui/components/dropdown-menu'; import { ReactNode } from 'react'; import ModeToggle from './mode-toggle'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { Icons } from '@ui/components/icons'; import { Button } from '@ui/components'; import LangToggle from './lang-toggle'; diff --git a/apps/wallet/components/voters-item.tsx b/apps/wallet/components/voters-item.tsx index 11248f2ae0f067c59ab2772582847b4bb2ab8ad8..05477a594bcaa240514f0812d910954e53261c74 100644 --- a/apps/wallet/components/voters-item.tsx +++ b/apps/wallet/components/voters-item.tsx @@ -1,4 +1,4 @@ -import Link from 'next/link'; +import { Link } from '@hive/ui'; function VotersItem({ username, hp, proxy }: { username: string; hp: number; proxy: number }) { return ( diff --git a/apps/wallet/components/wallet-menu.tsx b/apps/wallet/components/wallet-menu.tsx index 6d25f14ee78cb71145a87fc1d79b72dcb436c4da..31647fd15e7007064f302c0b4e2f2001cdac0030 100644 --- a/apps/wallet/components/wallet-menu.tsx +++ b/apps/wallet/components/wallet-menu.tsx @@ -1,4 +1,4 @@ -import Link from 'next/link'; +import { Link } from '@hive/ui'; import clsx from 'clsx'; import { useRouter } from 'next/router'; import { useTranslation } from 'next-i18next'; diff --git a/apps/wallet/components/witness-vote-expiry-warning.tsx b/apps/wallet/components/witness-vote-expiry-warning.tsx index 8cbac3998eef338b7c58a4179583243129606e76..cbf22051183e56638aa5e19620f945ad91fb6103 100644 --- a/apps/wallet/components/witness-vote-expiry-warning.tsx +++ b/apps/wallet/components/witness-vote-expiry-warning.tsx @@ -1,6 +1,6 @@ import moment from 'moment'; import { useTranslation } from 'next-i18next'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import HoverClickTooltip from './hover-click-tooltip'; const HIVE_NULL_DATE = 2016; // The year when the Hive blockchain was created diff --git a/apps/wallet/components/witnesses-list-item.tsx b/apps/wallet/components/witnesses-list-item.tsx index 76cf12e026ce4ff0340f3b38af79ddd860d5e1e0..c23adc566a3254c08e69f001b6daf4c72412e776 100644 --- a/apps/wallet/components/witnesses-list-item.tsx +++ b/apps/wallet/components/witnesses-list-item.tsx @@ -1,4 +1,4 @@ -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { ExtendWitness } from '@/wallet/pages/~witnesses'; import clsx from 'clsx'; import { DISABLED_SIGNING_KEY } from '@/wallet/lib/constants'; diff --git a/apps/wallet/feature/delegations/rc-row.tsx b/apps/wallet/feature/delegations/rc-row.tsx index e335f33cdd4b7afa5666c1d2ab21603f4101bd7f..f0e4ad30781257a423a5a0276698b347824e7c3f 100644 --- a/apps/wallet/feature/delegations/rc-row.tsx +++ b/apps/wallet/feature/delegations/rc-row.tsx @@ -1,5 +1,5 @@ import { prepareRC } from '@/wallet/lib/utils'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { useUndelegateMutation } from './hooks/use-undelegate-mutation'; import { Button } from '@ui/components'; import { CircleSpinner } from 'react-spinners-kit'; diff --git a/apps/wallet/pages/404.tsx b/apps/wallet/pages/404.tsx index 58edf10c42c3192d6fc8495a72f818a4f2da989f..ba3dc12f11001163c2667b2e18fc32b96a6e9ddf 100644 --- a/apps/wallet/pages/404.tsx +++ b/apps/wallet/pages/404.tsx @@ -1,6 +1,6 @@ import { Icons } from '@ui/components/icons'; import { GetStaticProps } from 'next'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; import { i18n } from '@/wallet/next-i18next.config'; import { useTranslation } from 'next-i18next'; diff --git a/apps/wallet/pages/[param]/author-rewards.tsx b/apps/wallet/pages/[param]/author-rewards.tsx index 4eeb63429201e60de2effa0c24d2e6d0ae8d99f0..d0908ade79623f0baa03c45ab17b99de637db333 100644 --- a/apps/wallet/pages/[param]/author-rewards.tsx +++ b/apps/wallet/pages/[param]/author-rewards.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'next-i18next'; import { getAccountMetadata, getTranslations } from '@/wallet/lib/get-translations'; import Head from 'next/head'; import { useRewardsHistory } from '@/wallet/components/hooks/use-rewards-history'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import env from '@beam-australia/react-env'; import { convertStringToBig } from '@ui/lib/helpers'; import { convertToHP } from '@ui/lib/utils'; diff --git a/apps/wallet/pages/[param]/communities.tsx b/apps/wallet/pages/[param]/communities.tsx index 76e01d1cf5b85dbb542601493580b79653dfa3a0..f5f49c36d1235bdc7896663cb3454ff76f155791 100644 --- a/apps/wallet/pages/[param]/communities.tsx +++ b/apps/wallet/pages/[param]/communities.tsx @@ -31,7 +31,7 @@ import { handleError } from '@ui/lib/handle-error'; import { useQuery } from '@tanstack/react-query'; import { useUser } from '@smart-signer/lib/auth/use-user'; import Loading from '@ui/components/loading'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import env from '@beam-australia/react-env'; import { getFindAccounts } from '@transaction/lib/hive-api'; import { getAccount } from '@transaction/lib/hive-api'; diff --git a/apps/wallet/pages/[param]/curation-rewards.tsx b/apps/wallet/pages/[param]/curation-rewards.tsx index 2ce5b4965ff6b6a6746172f6d801867774c45182..50bf71b9fbb522b53ae25a18e574d8bb43c6a149 100644 --- a/apps/wallet/pages/[param]/curation-rewards.tsx +++ b/apps/wallet/pages/[param]/curation-rewards.tsx @@ -5,7 +5,7 @@ import { getAccountMetadata, getTranslations } from '@/wallet/lib/get-translatio import Head from 'next/head'; import { useRewardsHistory } from '@/wallet/components/hooks/use-rewards-history'; import Loading from '@ui/components/loading'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { convertToHP } from '@ui/lib/utils'; import { convertStringToBig } from '@ui/lib/helpers'; import env from '@beam-australia/react-env'; diff --git a/apps/wallet/pages/[param]/password.tsx b/apps/wallet/pages/[param]/password.tsx index cae63574d0a54550689c2f81bd881ab7ffbb79da..b0e5b5c378113367f9bbc4c97212483dec2bb1e1 100644 --- a/apps/wallet/pages/[param]/password.tsx +++ b/apps/wallet/pages/[param]/password.tsx @@ -5,7 +5,7 @@ import * as z from 'zod'; import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '@ui/components/form'; import { useForm } from 'react-hook-form'; import { Checkbox, Separator } from '@hive/ui'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { useEffect, useMemo, useState } from 'react'; import { GetServerSideProps } from 'next'; import { useTranslation } from 'next-i18next'; diff --git a/apps/wallet/pages/[param]/permissions.tsx b/apps/wallet/pages/[param]/permissions.tsx index f69ecd2ec282d5f778e3cf920d011ad03784cec0..0aa520997d4e64e68c6e5ac4579ef06faf18c0aa 100644 --- a/apps/wallet/pages/[param]/permissions.tsx +++ b/apps/wallet/pages/[param]/permissions.tsx @@ -2,7 +2,7 @@ import { GetServerSideProps, InferGetServerSidePropsType } from 'next'; import ProfileLayout from '@/wallet/components/common/profile-layout'; import WalletMenu from '@/wallet/components/wallet-menu'; import { Card, Separator } from '@ui/components'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import { cn } from '@ui/lib/utils'; import { getAccountMetadata, getTranslations } from '@/wallet/lib/get-translations'; import { useTranslation } from 'next-i18next'; diff --git a/apps/wallet/pages/[param]/transfers.tsx b/apps/wallet/pages/[param]/transfers.tsx index f8bbe83e63bcd9508c682595326f0fcda44cf7a0..e17b9e13a706252c9cf6907b8e178889a1f74403 100644 --- a/apps/wallet/pages/[param]/transfers.tsx +++ b/apps/wallet/pages/[param]/transfers.tsx @@ -20,7 +20,7 @@ import { powerdownHive, cn, convertToHP, numberWithCommas } from '@ui/lib/utils' import { convertStringToBig } from '@ui/lib/helpers'; import { HiveOperation } from '@transaction/lib/extended-hive.chain'; import { GetServerSideProps, InferGetServerSidePropsType } from 'next'; -import Link from 'next/link'; +import { Link } from '@hive/ui'; import Loading from '@ui/components/loading'; import TransfersHistoryFilter from '@/wallet/components/transfers-history-filter'; import ProfileLayout from '@/wallet/components/common/profile-layout'; diff --git a/packages/eslint-config-custom/index.js b/packages/eslint-config-custom/index.js index 28c6b4a9788b7fa3f6f53495aa4a207bee36e807..1cd25321e2c1b04043cce4d2af579a31623cf8c7 100644 --- a/packages/eslint-config-custom/index.js +++ b/packages/eslint-config-custom/index.js @@ -14,7 +14,20 @@ module.exports = { 'react/react-in-jsx-scope': 'off', 'react/prop-types': 'off', 'react-hooks/rules-of-hooks': 'error', - 'react-hooks/exhaustive-deps': 'warn' + 'react-hooks/exhaustive-deps': 'warn', + 'turbo/no-undeclared-env-vars': 'off', + 'no-restricted-imports': [ + 'error', + { + paths: [ + { + name: 'next/link', + message: + 'Use { Link } from "@hive/ui" instead for prefetch={false} by default' + } + ] + } + ] }, env: { browser: true, diff --git a/packages/ui/components/index.tsx b/packages/ui/components/index.tsx index 32d7d44682ab4fcb0aa00fa06a5b984ce06c18ba..895f299e8837ce7727c6cb4cfcaa38491bf427c0 100644 --- a/packages/ui/components/index.tsx +++ b/packages/ui/components/index.tsx @@ -33,6 +33,7 @@ export * from "./toast"; export * from "./toaster"; export * from "./toggle"; export * from "./tooltip"; +export * from "./link"; // utility exports export * from "../lib/avatar-utils"; diff --git a/packages/ui/components/link.tsx b/packages/ui/components/link.tsx new file mode 100644 index 0000000000000000000000000000000000000000..6732a50d20f5166680afd9d13af81302f04d3f40 --- /dev/null +++ b/packages/ui/components/link.tsx @@ -0,0 +1,20 @@ +import NextLink, { LinkProps as NextLinkProps } from 'next/link'; +import { AnchorHTMLAttributes, forwardRef } from 'react'; + +export interface LinkProps + extends NextLinkProps, + Omit, keyof NextLinkProps> { + children?: React.ReactNode; +} + +/** + * Custom Link component that wraps Next.js Link with prefetch disabled by default. + * This prevents excessive server-side API calls from automatic prefetching. + * + * Use prefetch={true} explicitly when you need prefetching for specific links. + */ +export const Link = forwardRef( + ({ prefetch = false, ...props }, ref) => +); + +Link.displayName = 'Link';