change: remove 'My LBRY' and move publishes/downloads/history to top level in sidebar

This commit is contained in:
Sean Yesmunt 2019-01-23 12:15:50 -05:00
parent 7aa29417b8
commit 82e041c197
3 changed files with 53 additions and 55 deletions

View file

@ -2,23 +2,31 @@
import * as ICONS from 'constants/icons';
import React from 'react';
type IconProps = {
size: number,
color: string,
};
// Returns a react component
const buildIcon = iconStrokes => ({ size = 24, color = 'currentColor', ...otherProps }) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width={size}
height={size}
fill="none"
stroke={color}
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...otherProps}
>
{iconStrokes}
</svg>
);
const buildIcon = iconStrokes => (props: IconProps) => {
const { size = 24, color = 'currentColor', ...otherProps } = props;
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width={size}
height={size}
fill="none"
stroke={color}
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
{...otherProps}
>
{iconStrokes}
</svg>
);
};
export const customIcons = {
[ICONS.ARROW_LEFT]: buildIcon(
@ -93,4 +101,13 @@ export const customIcons = {
/>
</g>
),
[ICONS.PUBLISHED]: buildIcon(
<g fill="none" fillRule="evenodd" strokeLinecap="round">
<path
d="M8, 18 L5, 18 L5, 18 C2.790861, 18 1, 16.209139 1, 14 C1, 11.790861 2.790861, 10 5, 10 C5.35840468, 10 5.70579988, 10.0471371 6.03632437, 10.1355501 C6.01233106, 9.92702603 6, 9.71495305 6, 9.5 C6, 6.46243388 8.46243388, 4 11.5, 4 C14.0673313, 4 16.2238156, 5.7590449 16.8299648, 8.1376465 C17.2052921, 8.04765874 17.5970804, 8 18, 8 C20.7614237, 8 23, 10.2385763 23, 13 C23, 15.7614237 20.7614237, 18 18, 18 L16, 18, L8, 18"
strokeLinejoin="round"
transform="scale(1, 1.2) translate(0, -2)"
/>
</g>
),
};

View file

@ -11,6 +11,7 @@ export const ARROW_LEFT = 'ChevronLeft';
export const ARROW_RIGHT = 'ChevronRight';
export const DOWNLOAD = 'Download';
export const UPLOAD = 'UploadCloud';
export const PUBLISHED = 'Cloud';
export const CLOSE = 'X';
export const EDIT = 'Edit3';
export const DELETE = 'Trash';

View file

@ -106,9 +106,6 @@ export const selectNavLinks = createSelector(
page === 'history' ||
page === 'backup';
const isMyLbryPage = page =>
page === 'downloaded' || page === 'published' || page === 'user_history';
const previousStack = historyStack.slice().reverse();
const getPreviousSubLinkPath = checkIfValidPage => {
@ -130,16 +127,12 @@ export const selectNavLinks = createSelector(
if (category === 'wallet') {
const previousPath = getPreviousSubLinkPath(isWalletPage);
return previousPath || '/wallet';
} else if (category === 'myLbry') {
const previousPath = getPreviousSubLinkPath(isMyLbryPage);
return previousPath || '/downloaded';
}
return undefined;
};
const isCurrentlyWalletPage = isWalletPage(currentPage);
const isCurrentlyMyLbryPage = isMyLbryPage(currentPage);
const walletSubLinks = [
{
@ -174,24 +167,6 @@ export const selectNavLinks = createSelector(
},
];
const myLbrySubLinks = [
{
label: 'Downloads',
path: '/downloaded',
active: currentPage === 'downloaded',
},
{
label: 'Publishes',
path: '/published',
active: currentPage === 'published',
},
{
label: 'History',
path: '/user_history',
active: currentPage === 'user_history',
},
];
const navLinks = {
primary: [
{
@ -204,35 +179,40 @@ export const selectNavLinks = createSelector(
label: 'Subscriptions',
path: '/subscriptions',
active: currentPage === 'subscriptions',
icon: icons.HEART,
icon: icons.SUBSCRIPTION,
},
],
secondary: [
{
label: 'Wallet',
icon: icons.CREDIT_CARD,
icon: icons.WALLET,
subLinks: walletSubLinks,
path: isCurrentlyWalletPage ? '/wallet' : getActiveSublink('wallet'),
active: isWalletPage(currentPage),
},
{
label: 'My LBRY',
icon: icons.LOCAL,
subLinks: myLbrySubLinks,
path: isCurrentlyMyLbryPage ? '/downloaded' : getActiveSublink('myLbry'),
active: isMyLbryPage(currentPage),
},
{
label: 'Invite',
icon: icons.USERS,
icon: icons.INVITE,
path: '/invite',
active: currentPage === 'invite',
},
{
label: 'Publish',
icon: icons.UPLOAD,
path: '/publish',
active: currentPage === 'publish',
label: 'Downloads',
icon: icons.LOCAL,
path: '/downloaded',
active: currentPage === 'downloaded',
},
{
label: 'Publishes',
icon: icons.PUBLISHED,
path: '/published',
active: currentPage === 'published',
},
{
label: 'History',
icon: icons.HISTORY,
path: '/user_history',
active: currentPage === 'user_history',
},
{
label: 'Settings',