From 14cac0cf0e88d2a158866add033033df87aa1af4 Mon Sep 17 00:00:00 2001 From: Daniil Polienko Date: Wed, 20 Nov 2024 14:01:41 +0300 Subject: [PATCH] updage: links --- apps/common/components/Header.tsx | 2 +- apps/common/components/MobileNavbar.tsx | 4 +-- apps/common/components/MobileTopNav.tsx | 4 +-- apps/common/components/ModalMobileMenu.tsx | 8 ++--- apps/common/components/Sidebar.tsx | 14 +++++--- apps/common/utils/constants.tsx | 2 +- apps/landing/components/common/Header.tsx | 2 +- apps/landing/components/sections/Form.tsx | 36 +++++-------------- apps/landing/components/sections/Hero.tsx | 4 +-- .../components/sections/WaysToEarn.tsx | 8 ++--- pages/_app.tsx | 8 ++--- pages/_document.tsx | 2 +- pages/{home => apps}/[category].tsx | 2 +- pages/{home => apps}/index.tsx | 8 ++--- pages/{home => apps}/search/[query].tsx | 2 +- 15 files changed, 46 insertions(+), 60 deletions(-) rename pages/{home => apps}/[category].tsx (95%) rename pages/{home => apps}/index.tsx (91%) rename pages/{home => apps}/search/[query].tsx (99%) diff --git a/apps/common/components/Header.tsx b/apps/common/components/Header.tsx index 00f49a964..d52c42050 100644 --- a/apps/common/components/Header.tsx +++ b/apps/common/components/Header.tsx @@ -95,7 +95,7 @@ function AppHeader(props: {supportedNetworks: Chain[]}): ReactElement { const [isMenuOpen, set_isMenuOpen] = useState(false); const menu = useMemo((): TMenu[] => { - const HOME_MENU = {path: '/', label: 'Home'}; + const HOME_MENU = {path: '/apps', label: 'Apps'}; if (pathname.startsWith('/ycrv')) { return [HOME_MENU, ...APPS[AppName.YCRV].menu]; diff --git a/apps/common/components/MobileNavbar.tsx b/apps/common/components/MobileNavbar.tsx index ca54468c4..e2e3b5361 100644 --- a/apps/common/components/MobileNavbar.tsx +++ b/apps/common/components/MobileNavbar.tsx @@ -11,7 +11,7 @@ import type {ReactElement} from 'react'; export function MobileNavbar({onClose}: {onClose: VoidFunction}): ReactElement { const pathName = usePathname(); - const currentTab = pathName?.startsWith('/home/') ? pathName?.split('/')[2] : '/'; + const currentTab = pathName?.startsWith('/apps') ? pathName?.split('/')[2] : '/'; return (
+ href={tab.route === '/apps' ? tab.route : `/apps/${tab.route}`}>
{iconsDict[tab.route as keyof typeof iconsDict]}
diff --git a/apps/common/components/MobileTopNav.tsx b/apps/common/components/MobileTopNav.tsx index 7af71bfb2..815655445 100644 --- a/apps/common/components/MobileTopNav.tsx +++ b/apps/common/components/MobileTopNav.tsx @@ -1,12 +1,12 @@ import {type ReactElement, useCallback} from 'react'; import {useRouter} from 'next/router'; import {useSearch} from '@common/contexts/useSearch'; +import {IconBurgerPlain} from '@common/icons/IconBurgerPlain'; import {IconCross} from '@common/icons/IconCross'; import {IconSearch} from '@common/icons/IconSearch'; import {LogoYearn} from '@common/icons/LogoYearn'; import {SearchBar} from './SearchBar'; -import {IconBurgerPlain} from '@common/icons/IconBurgerPlain'; export function MobileTopNav({ isSearchOpen, @@ -26,7 +26,7 @@ export function MobileTopNav({ if (!configuration.searchValue) { return; } - router.push(`/home/search?query=${configuration.searchValue}`); + router.push(`/apps/search/${encodeURIComponent(configuration.searchValue)}`); }, [configuration.searchValue, router]); return ( diff --git a/apps/common/components/ModalMobileMenu.tsx b/apps/common/components/ModalMobileMenu.tsx index 2ccbacc82..175306ead 100644 --- a/apps/common/components/ModalMobileMenu.tsx +++ b/apps/common/components/ModalMobileMenu.tsx @@ -15,7 +15,7 @@ import type {TMenu} from '@yearn-finance/web-lib/components/Header'; export function FooterNav(): ReactElement { const menu = useMemo((): TMenu[] => { - const HOME_MENU = {path: '/', label: 'Home'}; + const HOME_MENU = {path: '/apps', label: 'Apps'}; return [ HOME_MENU, @@ -48,19 +48,19 @@ export function FooterNav(): ReactElement {
diff --git a/apps/common/components/Sidebar.tsx b/apps/common/components/Sidebar.tsx index 6efc6ce01..d70fefe0e 100644 --- a/apps/common/components/Sidebar.tsx +++ b/apps/common/components/Sidebar.tsx @@ -19,14 +19,14 @@ export function Sidebar(props: TSidebarProps): ReactElement { const router = useRouter(); const {configuration, dispatch} = useSearch(); - const currentTab = pathName?.startsWith('/home/') ? pathName?.split('/')[2] : '/'; + const currentTab = pathName?.startsWith('/apps') ? pathName?.split('/')[2] : '/'; const onSearchClick = useCallback(() => { if (!configuration.searchValue) { - router.push('/'); + router.push('/apps'); return; } - router.push(`/home/search/${encodeURIComponent(configuration.searchValue)}`); + router.push(`/apps/search/${encodeURIComponent(configuration.searchValue)}`); }, [configuration.searchValue, router]); return ( @@ -64,10 +64,14 @@ export function Sidebar(props: TSidebarProps): ReactElement { 'py-2 px-[28px] flex gap-4 text-base hover:bg-gray-600/40', currentTab === tab.route ? 'text-white font-bold' : 'text-gray-400' )} - href={tab.route === '/' ? tab.route : `/home/${tab.route}`} + href={tab.route === '/apps' ? tab.route : `/apps/${tab.route}`} key={tab.route}>
- {iconsDict[tab.route as '/' | 'community-apps' | 'vaults' | 'yearn-x' | 'integrations']} + { + iconsDict[ + tab.route as '/apps' | 'community-apps' | 'vaults' | 'yearn-x' | 'integrations' + ] + }

{tab.title}

diff --git a/apps/common/utils/constants.tsx b/apps/common/utils/constants.tsx index 75aba9e45..d80cddf87 100644 --- a/apps/common/utils/constants.tsx +++ b/apps/common/utils/constants.tsx @@ -280,7 +280,7 @@ export const CATEGORY_PAGE_FILTERS = [ ]; export const iconsDict = { - '/': , + '/apps': , about: , vaults: , 'community-apps': , diff --git a/apps/landing/components/common/Header.tsx b/apps/landing/components/common/Header.tsx index 567020ef4..f5318ee1e 100644 --- a/apps/landing/components/common/Header.tsx +++ b/apps/landing/components/common/Header.tsx @@ -32,7 +32,7 @@ export function LandingAppHeader(): ReactElement { const [isMenuOpen, set_isMenuOpen] = useState(false); const menu = useMemo((): TMenu[] => { - const HOME_MENU = {path: '/home', label: 'Home'}; + const HOME_MENU = {path: '/apps', label: 'Apps'}; return [ HOME_MENU, diff --git a/apps/landing/components/sections/Form.tsx b/apps/landing/components/sections/Form.tsx index 3f5750e99..b080b6cc6 100644 --- a/apps/landing/components/sections/Form.tsx +++ b/apps/landing/components/sections/Form.tsx @@ -1,3 +1,5 @@ +import Link from 'next/link'; + import {Button} from '../common/Button'; import type {ReactElement} from 'react'; @@ -8,34 +10,14 @@ export function Form(): ReactElement { className={'flex max-w-6xl flex-col items-center pt-[160px]'} id={'form'}>

- {'SUBMIT YOUR APP IDEA OR INTEGRATION'} + {'SUBMIT YOUR APP OR INTEGRATION'}

-
- - - -