From 3744aa13d453fda37da9bfd74c804f6ec8a002b8 Mon Sep 17 00:00:00 2001 From: spencerwooo Date: Thu, 26 Jan 2023 13:43:00 +0800 Subject: [PATCH] feat: use nextjs 13 links --- components/Breadcrumb.tsx | 19 +++++++----------- components/FolderGridLayout.tsx | 4 +--- components/FolderListLayout.tsx | 10 ++++++---- components/Navbar.tsx | 8 +++----- components/SearchModal.tsx | 34 ++++++++++++++++----------------- components/SwitchLang.tsx | 4 ++-- 6 files changed, 36 insertions(+), 43 deletions(-) diff --git a/components/Breadcrumb.tsx b/components/Breadcrumb.tsx index 4e96a31..4a54e0f 100644 --- a/components/Breadcrumb.tsx +++ b/components/Breadcrumb.tsx @@ -8,11 +8,9 @@ const HomeCrumb = () => { const { t } = useTranslation() return ( - - - - {t('Home')} - + + + {t('Home')} ) } @@ -37,14 +35,11 @@ const Breadcrumb: React.FC<{ query?: ParsedUrlQuery }> = ({ query }) => { .map(p => encodeURIComponent(p)) .join('/')}`} passHref + className={`ml-1 transition-all duration-75 hover:opacity-70 md:ml-3 ${ + i == 0 && 'pointer-events-none opacity-80' + }`} > - - {p} - + {p} ))} diff --git a/components/FolderGridLayout.tsx b/components/FolderGridLayout.tsx index 9e4cbac..620100e 100644 --- a/components/FolderGridLayout.tsx +++ b/components/FolderGridLayout.tsx @@ -176,9 +176,7 @@ const FolderGridLayout = ({ - - - + ))} diff --git a/components/FolderListLayout.tsx b/components/FolderListLayout.tsx index b0a1b94..840434e 100644 --- a/components/FolderListLayout.tsx +++ b/components/FolderListLayout.tsx @@ -96,10 +96,12 @@ const FolderListLayout = ({ className="grid grid-cols-12 transition-all duration-100 hover:bg-gray-100 dark:hover:bg-gray-850" key={c.id} > - - - - + + {c.folder ? ( diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 47a796f..7b87999 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -64,11 +64,9 @@ const Navbar = () => {
- - - icon - {siteConfig.title} - + + icon + {siteConfig.title}
diff --git a/components/SearchModal.tsx b/components/SearchModal.tsx index f02c9d4..2c014a1 100644 --- a/components/SearchModal.tsx +++ b/components/SearchModal.tsx @@ -90,24 +90,24 @@ function SearchResultItemTemplate({ disabled: boolean }) { return ( - - - -
-
{driveItem.name}
-
- {itemDescription} -
+ + +
) } diff --git a/components/SwitchLang.tsx b/components/SwitchLang.tsx index d31b5f2..67530ef 100644 --- a/components/SwitchLang.tsx +++ b/components/SwitchLang.tsx @@ -9,8 +9,8 @@ import { useCookies, withCookies } from 'react-cookie' // https://headlessui.dev/react/menu#integrating-with-next-js const CustomLink = ({ href, children, as, locale, ...props }): JSX.Element => { return ( - - {children} + + {children} ) }