This commit is contained in:
zeppi 2022-04-14 20:09:46 -04:00
parent 80e41b520c
commit 890642ee02

View file

@ -18,10 +18,6 @@ import { DOMAIN, ENABLE_UI_NOTIFICATIONS } from 'config';
const FOLLOWED_ITEM_INITIAL_LIMIT = 10; const FOLLOWED_ITEM_INITIAL_LIMIT = 10;
const touch = isTouch(); const touch = isTouch();
const {
location: { pathname },
} = useHistory();
type SideNavLink = { type SideNavLink = {
title: string, title: string,
link?: string, link?: string,
@ -32,69 +28,6 @@ type SideNavLink = {
hideForUnauth?: boolean, 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: <NotificationBubble inline />,
};
const PLAYLISTS = {
title: 'Lists',
link: `/$/${PAGES.LISTS}`,
icon: ICONS.STACK,
};
const UNAUTH_LINKS: Array<SideNavLink> = [
{
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, followedTags,
} = props; } = 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: <NotificationBubble inline />,
};
const PLAYLISTS = {
title: 'Lists',
link: `/$/${PAGES.LISTS}`,
icon: ICONS.STACK,
};
const UNAUTH_LINKS: Array<SideNavLink> = [
{
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<SideNavLink> = [ const MOBILE_LINKS: Array<SideNavLink> = [
{ {
title: 'Upload', title: 'Upload',