change: remove 'My LBRY' and move publishes/downloads/history to top level in sidebar
This commit is contained in:
parent
7aa29417b8
commit
82e041c197
3 changed files with 53 additions and 55 deletions
|
@ -2,23 +2,31 @@
|
||||||
import * as ICONS from 'constants/icons';
|
import * as ICONS from 'constants/icons';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
type IconProps = {
|
||||||
|
size: number,
|
||||||
|
color: string,
|
||||||
|
};
|
||||||
|
|
||||||
// Returns a react component
|
// Returns a react component
|
||||||
const buildIcon = iconStrokes => ({ size = 24, color = 'currentColor', ...otherProps }) => (
|
const buildIcon = iconStrokes => (props: IconProps) => {
|
||||||
<svg
|
const { size = 24, color = 'currentColor', ...otherProps } = props;
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
return (
|
||||||
viewBox="0 0 24 24"
|
<svg
|
||||||
width={size}
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
height={size}
|
viewBox="0 0 24 24"
|
||||||
fill="none"
|
width={size}
|
||||||
stroke={color}
|
height={size}
|
||||||
strokeWidth="2"
|
fill="none"
|
||||||
strokeLinecap="round"
|
stroke={color}
|
||||||
strokeLinejoin="round"
|
strokeWidth="2"
|
||||||
{...otherProps}
|
strokeLinecap="round"
|
||||||
>
|
strokeLinejoin="round"
|
||||||
{iconStrokes}
|
{...otherProps}
|
||||||
</svg>
|
>
|
||||||
);
|
{iconStrokes}
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const customIcons = {
|
export const customIcons = {
|
||||||
[ICONS.ARROW_LEFT]: buildIcon(
|
[ICONS.ARROW_LEFT]: buildIcon(
|
||||||
|
@ -93,4 +101,13 @@ export const customIcons = {
|
||||||
/>
|
/>
|
||||||
</g>
|
</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>
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,6 +11,7 @@ export const ARROW_LEFT = 'ChevronLeft';
|
||||||
export const ARROW_RIGHT = 'ChevronRight';
|
export const ARROW_RIGHT = 'ChevronRight';
|
||||||
export const DOWNLOAD = 'Download';
|
export const DOWNLOAD = 'Download';
|
||||||
export const UPLOAD = 'UploadCloud';
|
export const UPLOAD = 'UploadCloud';
|
||||||
|
export const PUBLISHED = 'Cloud';
|
||||||
export const CLOSE = 'X';
|
export const CLOSE = 'X';
|
||||||
export const EDIT = 'Edit3';
|
export const EDIT = 'Edit3';
|
||||||
export const DELETE = 'Trash';
|
export const DELETE = 'Trash';
|
||||||
|
|
|
@ -106,9 +106,6 @@ export const selectNavLinks = createSelector(
|
||||||
page === 'history' ||
|
page === 'history' ||
|
||||||
page === 'backup';
|
page === 'backup';
|
||||||
|
|
||||||
const isMyLbryPage = page =>
|
|
||||||
page === 'downloaded' || page === 'published' || page === 'user_history';
|
|
||||||
|
|
||||||
const previousStack = historyStack.slice().reverse();
|
const previousStack = historyStack.slice().reverse();
|
||||||
|
|
||||||
const getPreviousSubLinkPath = checkIfValidPage => {
|
const getPreviousSubLinkPath = checkIfValidPage => {
|
||||||
|
@ -130,16 +127,12 @@ export const selectNavLinks = createSelector(
|
||||||
if (category === 'wallet') {
|
if (category === 'wallet') {
|
||||||
const previousPath = getPreviousSubLinkPath(isWalletPage);
|
const previousPath = getPreviousSubLinkPath(isWalletPage);
|
||||||
return previousPath || '/wallet';
|
return previousPath || '/wallet';
|
||||||
} else if (category === 'myLbry') {
|
|
||||||
const previousPath = getPreviousSubLinkPath(isMyLbryPage);
|
|
||||||
return previousPath || '/downloaded';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
const isCurrentlyWalletPage = isWalletPage(currentPage);
|
const isCurrentlyWalletPage = isWalletPage(currentPage);
|
||||||
const isCurrentlyMyLbryPage = isMyLbryPage(currentPage);
|
|
||||||
|
|
||||||
const walletSubLinks = [
|
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 = {
|
const navLinks = {
|
||||||
primary: [
|
primary: [
|
||||||
{
|
{
|
||||||
|
@ -204,35 +179,40 @@ export const selectNavLinks = createSelector(
|
||||||
label: 'Subscriptions',
|
label: 'Subscriptions',
|
||||||
path: '/subscriptions',
|
path: '/subscriptions',
|
||||||
active: currentPage === 'subscriptions',
|
active: currentPage === 'subscriptions',
|
||||||
icon: icons.HEART,
|
icon: icons.SUBSCRIPTION,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
secondary: [
|
secondary: [
|
||||||
{
|
{
|
||||||
label: 'Wallet',
|
label: 'Wallet',
|
||||||
icon: icons.CREDIT_CARD,
|
icon: icons.WALLET,
|
||||||
subLinks: walletSubLinks,
|
subLinks: walletSubLinks,
|
||||||
path: isCurrentlyWalletPage ? '/wallet' : getActiveSublink('wallet'),
|
path: isCurrentlyWalletPage ? '/wallet' : getActiveSublink('wallet'),
|
||||||
active: isWalletPage(currentPage),
|
active: isWalletPage(currentPage),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'My LBRY',
|
|
||||||
icon: icons.LOCAL,
|
|
||||||
subLinks: myLbrySubLinks,
|
|
||||||
path: isCurrentlyMyLbryPage ? '/downloaded' : getActiveSublink('myLbry'),
|
|
||||||
active: isMyLbryPage(currentPage),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: 'Invite',
|
label: 'Invite',
|
||||||
icon: icons.USERS,
|
icon: icons.INVITE,
|
||||||
path: '/invite',
|
path: '/invite',
|
||||||
active: currentPage === 'invite',
|
active: currentPage === 'invite',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Publish',
|
label: 'Downloads',
|
||||||
icon: icons.UPLOAD,
|
icon: icons.LOCAL,
|
||||||
path: '/publish',
|
path: '/downloaded',
|
||||||
active: currentPage === 'publish',
|
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',
|
label: 'Settings',
|
||||||
|
|
Loading…
Add table
Reference in a new issue