From 890642ee022555b78fdb2e6d8f7af8d2aec1a6cc Mon Sep 17 00:00:00 2001 From: zeppi Date: Thu, 14 Apr 2022 20:09:46 -0400 Subject: [PATCH] fix hook --- ui/component/sideNavigation/view.jsx | 134 +++++++++++++-------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/ui/component/sideNavigation/view.jsx b/ui/component/sideNavigation/view.jsx index 6616ac606..08ef0e955 100644 --- a/ui/component/sideNavigation/view.jsx +++ b/ui/component/sideNavigation/view.jsx @@ -18,10 +18,6 @@ import { DOMAIN, ENABLE_UI_NOTIFICATIONS } from 'config'; const FOLLOWED_ITEM_INITIAL_LIMIT = 10; const touch = isTouch(); -const { - location: { pathname }, -} = useHistory(); - type SideNavLink = { title: string, link?: string, @@ -32,69 +28,6 @@ type SideNavLink = { hideForUnauth?: boolean, }; -const HOME = { - title: 'Home', - link: `/`, - icon: ICONS.HOME, - onClick: () => { - if (pathname === '/') window.location.reload(); - }, -}; - -const RECENT_FROM_FOLLOWING = { - title: 'Following --[sidebar button]--', - link: `/$/${PAGES.CHANNELS_FOLLOWING}`, - icon: ICONS.SUBSCRIBE, -}; - -const DISCOVER = { - title: 'Discover', - link: `/$/${PAGES.DISCOVER}`, - icon: ICONS.DISCOVER, -}; - -const LIBRARY = { - title: 'Library', - link: `/$/${PAGES.LIBRARY}`, - icon: ICONS.PURCHASED, -}; - -const NOTIFICATIONS = { - title: 'Notifications', - link: `/$/${PAGES.NOTIFICATIONS}`, - icon: ICONS.NOTIFICATION, - extra: , -}; - -const PLAYLISTS = { - title: 'Lists', - link: `/$/${PAGES.LISTS}`, - icon: ICONS.STACK, -}; - -const UNAUTH_LINKS: Array = [ - { - title: 'Log In', - link: `/$/${PAGES.AUTH_SIGNIN}`, - icon: ICONS.SIGN_IN, - }, - { - title: 'Sign Up', - link: `/$/${PAGES.AUTH}`, - icon: ICONS.SIGN_UP, - }, - { - title: 'Settings', - link: `/$/${PAGES.SETTINGS}`, - icon: ICONS.SETTINGS, - }, - { - title: 'Help', - link: `/$/${PAGES.HELP}`, - icon: ICONS.HELP, - }, -]; - // **************************************************************************** // **************************************************************************** @@ -132,6 +65,73 @@ function SideNavigation(props: Props) { followedTags, } = props; + const { + location: { pathname }, + } = useHistory(); + + const HOME = { + title: 'Home', + link: `/`, + icon: ICONS.HOME, + onClick: () => { + if (pathname === '/') window.location.reload(); + }, + }; + + const RECENT_FROM_FOLLOWING = { + title: 'Following --[sidebar button]--', + link: `/$/${PAGES.CHANNELS_FOLLOWING}`, + icon: ICONS.SUBSCRIBE, + }; + + const DISCOVER = { + title: 'Discover', + link: `/$/${PAGES.DISCOVER}`, + icon: ICONS.DISCOVER, + }; + + const LIBRARY = { + title: 'Library', + link: `/$/${PAGES.LIBRARY}`, + icon: ICONS.PURCHASED, + }; + + const NOTIFICATIONS = { + title: 'Notifications', + link: `/$/${PAGES.NOTIFICATIONS}`, + icon: ICONS.NOTIFICATION, + extra: , + }; + + const PLAYLISTS = { + title: 'Lists', + link: `/$/${PAGES.LISTS}`, + icon: ICONS.STACK, + }; + + const UNAUTH_LINKS: Array = [ + { + title: 'Log In', + link: `/$/${PAGES.AUTH_SIGNIN}`, + icon: ICONS.SIGN_IN, + }, + { + title: 'Sign Up', + link: `/$/${PAGES.AUTH}`, + icon: ICONS.SIGN_UP, + }, + { + title: 'Settings', + link: `/$/${PAGES.SETTINGS}`, + icon: ICONS.SETTINGS, + }, + { + title: 'Help', + link: `/$/${PAGES.HELP}`, + icon: ICONS.HELP, + }, + ]; + const MOBILE_LINKS: Array = [ { title: 'Upload',