diff --git a/ui/component/sideNavigation/view.jsx b/ui/component/sideNavigation/view.jsx index 7abe7cf1d..f3b3f53c9 100644 --- a/ui/component/sideNavigation/view.jsx +++ b/ui/component/sideNavigation/view.jsx @@ -25,6 +25,12 @@ type SideNavLink = { hideForUnauth?: boolean, }; +const GO_LIVE = { + title: 'Go Live', + link: `/$/${PAGES.LIVESTREAM}`, + icon: ICONS.VIDEO, +}; + const HOME = { title: 'Home', link: `/`, @@ -40,6 +46,14 @@ const RECENT_FROM_FOLLOWING = { icon: ICONS.SUBSCRIBE, }; +const NOTIFICATIONS = { + title: 'Notifications', + link: `/$/${PAGES.NOTIFICATIONS}`, + icon: ICONS.NOTIFICATION, + extra: , + hideForUnauth: true, +}; + const PLAYLISTS = { title: 'Lists', link: `/$/${PAGES.LISTS}`, @@ -70,6 +84,12 @@ const UNAUTH_LINKS: Array = [ }, ]; +const WILD_WEST = { + title: 'Wild West', + link: `/$/${PAGES.WILD_WEST}`, + icon: ICONS.WILD_WEST, +}; + // **************************************************************************** // **************************************************************************** @@ -112,13 +132,6 @@ function SideNavigation(props: Props) { const EXTRA_SIDEBAR_LINKS = GetLinksData(homepageData).map(({ pinnedUrls, ...theRest }) => theRest); const MOBILE_LINKS: Array = [ - { - title: 'Notifications', - link: `/$/${PAGES.NOTIFICATIONS}`, - icon: ICONS.NOTIFICATION, - extra: , - hideForUnauth: true, - }, { title: 'Upload', link: `/$/${PAGES.UPLOAD}`, @@ -190,26 +203,6 @@ function SideNavigation(props: Props) { const notificationsEnabled = ENABLE_UI_NOTIFICATIONS || (user && user.experimental_ui); const isAuthenticated = Boolean(email); - // SIDE LINKS: FOLLOWING, HOME, [FULL,] [EXTRA] - let SIDE_LINKS: Array = []; - - SIDE_LINKS.push(HOME); - SIDE_LINKS.push(RECENT_FROM_FOLLOWING); - SIDE_LINKS.push(PLAYLISTS); - - if (EXTRA_SIDEBAR_LINKS) { - // $FlowFixMe - SIDE_LINKS.push(...EXTRA_SIDEBAR_LINKS); - - const WILD_WEST = { - title: 'Wild West', - link: `/$/${PAGES.WILD_WEST}`, - icon: ICONS.WILD_WEST, - }; - - SIDE_LINKS.push(WILD_WEST); - } - const livestreamEnabled = Boolean( ENABLE_NO_SOURCE_CLAIMS && user && @@ -224,15 +217,6 @@ function SideNavigation(props: Props) { const isPersonalized = !IS_WEB || isAuthenticated; const isAbsolute = isOnFilePage || isMediumScreen; const microNavigation = !sidebarOpen || isMediumScreen; - const subLinks = email - ? MOBILE_LINKS.filter((link) => { - if (!notificationsEnabled && link.icon === ICONS.NOTIFICATION) { - return false; - } - - return true; - }) - : UNAUTH_LINKS; const showSubscriptionSection = sidebarOpen && isPersonalized && subscriptions && subscriptions.length > 0; const showTagSection = sidebarOpen && isPersonalized && followedTags && followedTags.length; @@ -247,6 +231,33 @@ function SideNavigation(props: Props) { displayedFollowedTags = followedTags.slice(0, FOLLOWED_ITEM_INITIAL_LIMIT); } + function getLink(props: SideNavLink) { + const { hideForUnauth, route, link, ...passedProps } = props; + const { title, icon, extra } = passedProps; + + if (hideForUnauth && !email) { + return null; + } + + return ( +
  • +
  • + ); + } + function getSubscriptionSection() { if (showSubscriptionSection) { return ( @@ -255,14 +266,15 @@ function SideNavigation(props: Props) { {displayedSubscriptions.map((subscription) => ( ))} + {subscriptions.length > FOLLOWED_ITEM_INITIAL_LIMIT && ( +