From c0e6de66a4266cd28b26ef9d4c00a2c081a49698 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Wed, 16 May 2018 22:49:51 -0400
Subject: [PATCH 01/10] don't use channel name in FileList
---
src/renderer/component/fileList/view.jsx | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)
diff --git a/src/renderer/component/fileList/view.jsx b/src/renderer/component/fileList/view.jsx
index 8bc26d362..1f649f527 100644
--- a/src/renderer/component/fileList/view.jsx
+++ b/src/renderer/component/fileList/view.jsx
@@ -8,6 +8,7 @@ type FileInfo = {
name: string,
channelName: ?string,
pending?: boolean,
+ channel_claim_id: string,
value?: {
publisherSignature: {
certificateId: string,
@@ -139,6 +140,8 @@ class FileList extends React.PureComponent {
});
}
+ sortFunctions: {};
+
render() {
const { fileInfos, hideFilter, checkPending } = this.props;
const { sortBy } = this.state;
@@ -149,27 +152,14 @@ class FileList extends React.PureComponent {
}
this.sortFunctions[sortBy](fileInfos).forEach(fileInfo => {
- const {
- channel_name: channelName,
- name: claimName,
- claim_name: claimNameDownloaded,
- claim_id: claimId,
- } = fileInfo;
+ const { name: claimName, claim_name: claimNameDownloaded, claim_id: claimId } = fileInfo;
const uriParams = {};
// This is unfortunate
// https://github.com/lbryio/lbry/issues/1159
const name = claimName || claimNameDownloaded;
-
- if (channelName) {
- uriParams.channelName = channelName;
- uriParams.contentName = name;
- uriParams.claimId = this.getChannelSignature(fileInfo);
- } else {
- uriParams.claimId = claimId;
- uriParams.claimName = name;
- }
-
+ uriParams.contentName = name;
+ uriParams.claimId = claimId;
const uri = buildURI(uriParams);
content.push( );
--
2.43.4
From 85191292118e48e7acd7399b5390d54d4219c973 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Wed, 16 May 2018 23:36:38 -0400
Subject: [PATCH 02/10] dropdown styling
---
src/renderer/scss/_gui.scss | 14 ++++++++++++++
src/renderer/scss/_vars.scss | 3 +++
src/renderer/scss/component/_form-field.scss | 2 +-
static/themes/dark.css | 6 ++++--
4 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/src/renderer/scss/_gui.scss b/src/renderer/scss/_gui.scss
index e7266b68b..d49071623 100644
--- a/src/renderer/scss/_gui.scss
+++ b/src/renderer/scss/_gui.scss
@@ -121,6 +121,20 @@ input::placeholder {
opacity: 0.5;
}
+select {
+ min-width: 100px;
+ height: 30px;
+ border-radius: 8px;
+ background-color: var(--input-select-bg-color);
+ font: normal 12px/30px 'metropolis-medium';
+ text-indent: 12px;
+ color: var(--input-select-color);
+
+ &:disabled {
+ opacity: 0.5;
+ }
+}
+
button + input {
margin-left: $spacing-vertical * 2/3;
}
diff --git a/src/renderer/scss/_vars.scss b/src/renderer/scss/_vars.scss
index cdfe3ddcf..ea591571e 100644
--- a/src/renderer/scss/_vars.scss
+++ b/src/renderer/scss/_vars.scss
@@ -35,6 +35,7 @@ $large-breakpoint: 1760px;
--color-green-light: #effbe4;
--color-green-blue: #2ec1a8;
--color-purple: #8165b0;
+ --color-blue-grey: #203049;
/* Colors */
--color-divider: #e3e3e3;
@@ -73,6 +74,8 @@ $large-breakpoint: 1760px;
--input-copyable-bg: #f6f6f6;
--input-copyable-color: var(--color-grey-dark);
--input-copyable-border: var(--color-grey);
+ --input-select-bg-color: var(--color-grey);
+ --input-select-color: var(--text-color);
/* input:disabled */
--input-disabled-border-color: rgba(0, 0, 0, 0.42);
diff --git a/src/renderer/scss/component/_form-field.scss b/src/renderer/scss/component/_form-field.scss
index 2be99b8ab..406318e8e 100644
--- a/src/renderer/scss/component/_form-field.scss
+++ b/src/renderer/scss/component/_form-field.scss
@@ -103,7 +103,7 @@
// Not sure if I like these
// Maybe this should be in gui.scss?
.input--price-amount {
- width: 60px;
+ width: 80px;
}
.input--address {
diff --git a/static/themes/dark.css b/static/themes/dark.css
index 7796724ef..dc4d666b7 100644
--- a/static/themes/dark.css
+++ b/static/themes/dark.css
@@ -7,7 +7,7 @@
--color-help: #8696AF;
--color-download: rgba(255, 255, 255, 0.75);
--color-download-overlay: var(--color-black);
- --color-bg: #203049;
+ --color-bg: var(--color-blue-grey);
--color-bg-alt: #2D3D56;
--color-placeholder: var(--color-bg-alt);
@@ -26,9 +26,11 @@
--input-border-size: 1px;
--input-border-color: rgba(255,255,255, 0.5);
--input-hover-border-color: rgba(255, 255, 255, 1);
- --input-copyable-bg: #203049;
+ --input-copyable-bg: var(--color-blue-grey);
--input-copyable-color: #8696AF;
--input-copyable-border: #53637C;
+ --input-select-bg-color: var(--color-blue-grey);
+ --input-select-color: var(--color-white);
/* input:disabled */
--input-disabled-border-color: rgba(255, 255, 255, 0.42);
--
2.43.4
From 55209a21cf0b4935c9b78da6d2fc013a87e33fa4 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Thu, 17 May 2018 00:09:25 -0400
Subject: [PATCH 03/10] don't show rewards message if no claimable rewards
---
src/renderer/modal/modalCreditIntro/view.jsx | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/src/renderer/modal/modalCreditIntro/view.jsx b/src/renderer/modal/modalCreditIntro/view.jsx
index 96e2fb801..bacd4ce3f 100644
--- a/src/renderer/modal/modalCreditIntro/view.jsx
+++ b/src/renderer/modal/modalCreditIntro/view.jsx
@@ -25,16 +25,13 @@ const ModalCreditIntro = props => {
can take are limited.
)}
-
- There are a variety of ways to get credits, including more than{' '}
- {totalRewardValue ? (
-
- ) : (
- {__('?? credits')}
- )}{' '}
- {__(' in free rewards for participating in the LBRY beta.')}
-
-
+ {totalRewardValue && (
+
+ There are a variety of ways to get credits, including more than{' '}
+ {' '}
+ {__('in free rewards for participating in the LBRY beta.')}
+
+ )}
Date: Mon, 21 May 2018 16:30:00 -0400
Subject: [PATCH 04/10] move file actions below video player
---
src/renderer/component/common/icon.jsx | 6 +-
src/renderer/component/fileActions/view.jsx | 10 ++-
.../component/fileDownloadLink/view.jsx | 71 ++++++++++---------
.../component/subscribeButton/view.jsx | 2 +-
.../component/video/internal/play-button.jsx | 2 +-
src/renderer/page/file/view.jsx | 15 ++--
src/renderer/scss/component/_card.scss | 5 +-
.../scss/component/_file-download.scss | 25 +------
8 files changed, 63 insertions(+), 73 deletions(-)
diff --git a/src/renderer/component/common/icon.jsx b/src/renderer/component/common/icon.jsx
index b0a05d879..7bfc3ae0c 100644
--- a/src/renderer/component/common/icon.jsx
+++ b/src/renderer/component/common/icon.jsx
@@ -1,10 +1,10 @@
// @flow
import React from 'react';
-// import * as icons from 'constants/icons';
import * as FeatherIcons from 'react-feather';
import * as icons from 'constants/icons';
const RED_COLOR = '#e2495e';
+const PURPLE_COLOR = '#8165b0';
type Props = {
icon: string,
@@ -19,8 +19,10 @@ class IconComponent extends React.PureComponent {
const Icon = FeatherIcons[icon];
let color;
- if (icon === icons.HEART || icon === icons.FEATURED) {
+ if (icon === icons.TRASH || icon === icons.FEATURED) {
color = RED_COLOR;
+ } else if (icon === icons.OPEN) {
+ color = PURPLE_COLOR;
}
let size = 14;
diff --git a/src/renderer/component/fileActions/view.jsx b/src/renderer/component/fileActions/view.jsx
index 94995d245..a485cc90e 100644
--- a/src/renderer/component/fileActions/view.jsx
+++ b/src/renderer/component/fileActions/view.jsx
@@ -1,7 +1,6 @@
// @flow
import React from 'react';
import Button from 'component/button';
-import FileDownloadLink from 'component/fileDownloadLink';
import { MODALS } from 'lbry-redux';
import classnames from 'classnames';
import * as icons from 'constants/icons';
@@ -27,21 +26,20 @@ class FileActions extends React.PureComponent {
return (
-
{showDelete && (
openModal({ id: MODALS.CONFIRM_FILE_REMOVE }, { uri })}
/>
)}
{!claimIsMine && (
)}
diff --git a/src/renderer/component/fileDownloadLink/view.jsx b/src/renderer/component/fileDownloadLink/view.jsx
index c2c413bd6..0658ae253 100644
--- a/src/renderer/component/fileDownloadLink/view.jsx
+++ b/src/renderer/component/fileDownloadLink/view.jsx
@@ -1,19 +1,39 @@
+// @flow
import React from 'react';
import Button from 'component/button';
-import classnames from 'classnames';
import * as icons from 'constants/icons';
-class FileDownloadLink extends React.PureComponent {
+type Props = {
+ uri: string,
+ downloading: boolean,
+ fileInfo: ?{
+ written_bytes: number,
+ total_bytes: number,
+ outpoint: number,
+ download_path: string,
+ },
+ loading: boolean,
+ costInfo: ?{},
+ restartDownload: (string, number) => void,
+ checkAvailability: string => void,
+ openInShell: string => void,
+ purchaseUri: string => void,
+ doPause: () => void,
+};
+
+class FileDownloadLink extends React.PureComponent {
componentWillMount() {
this.checkAvailability(this.props.uri);
}
- componentWillReceiveProps(nextProps) {
+ componentWillReceiveProps(nextProps: Props) {
this.checkAvailability(nextProps.uri);
this.restartDownload(nextProps);
}
- restartDownload(props) {
+ uri: ?string;
+
+ restartDownload = (props: Props) => {
const { downloading, fileInfo, uri, restartDownload } = props;
if (
@@ -25,11 +45,11 @@ class FileDownloadLink extends React.PureComponent {
) {
restartDownload(uri, fileInfo.outpoint);
}
- }
+ };
- checkAvailability(uri) {
- if (!this._uri || uri !== this._uri) {
- this._uri = uri;
+ checkAvailability(uri: string) {
+ if (!this.uri || uri !== this.uri) {
+ this.uri = uri;
this.props.checkAvailability(uri);
}
}
@@ -47,8 +67,10 @@ class FileDownloadLink extends React.PureComponent {
} = this.props;
const openFile = () => {
- openInShell(fileInfo.download_path);
- doPause();
+ if (fileInfo) {
+ openInShell(fileInfo.download_path);
+ doPause();
+ }
};
if (loading || downloading) {
@@ -56,21 +78,11 @@ class FileDownloadLink extends React.PureComponent {
fileInfo && fileInfo.written_bytes
? fileInfo.written_bytes / fileInfo.total_bytes * 100
: 0;
- const label = fileInfo ? progress.toFixed(0) + __('% complete') : __('Connecting...');
+ const label = fileInfo
+ ? __('Downloading: ') + progress.toFixed(0) + __('% complete')
+ : __('Connecting...');
- return (
-
-
- {label}
-
- {label}
-
- );
+ return {label} ;
} else if (fileInfo === null && !downloading) {
if (!costInfo) {
return null;
@@ -78,8 +90,8 @@ class FileDownloadLink extends React.PureComponent {
return (
{
purchaseUri(uri);
@@ -88,12 +100,7 @@ class FileDownloadLink extends React.PureComponent {
);
} else if (fileInfo && fileInfo.download_path) {
return (
- openFile()}
- />
+ openFile()} />
);
}
diff --git a/src/renderer/component/subscribeButton/view.jsx b/src/renderer/component/subscribeButton/view.jsx
index 52516dfb8..5366d107a 100644
--- a/src/renderer/component/subscribeButton/view.jsx
+++ b/src/renderer/component/subscribeButton/view.jsx
@@ -38,7 +38,7 @@ export default (props: Props) => {
return channelName && uri ? (
{
if (!subscriptions.length) {
diff --git a/src/renderer/component/video/internal/play-button.jsx b/src/renderer/component/video/internal/play-button.jsx
index e2df7d455..8055dd5ff 100644
--- a/src/renderer/component/video/internal/play-button.jsx
+++ b/src/renderer/component/video/internal/play-button.jsx
@@ -18,7 +18,7 @@ class VideoPlayButton extends React.PureComponent {
const label = doesPlayback ? 'Play' : 'View';
return (
-
+
);
}
}
diff --git a/src/renderer/page/file/view.jsx b/src/renderer/page/file/view.jsx
index 5ebe44876..f6bec07aa 100644
--- a/src/renderer/page/file/view.jsx
+++ b/src/renderer/page/file/view.jsx
@@ -17,6 +17,8 @@ import Page from 'component/page';
import player from 'render-media';
import * as settings from 'constants/settings';
import type { Claim } from 'types/claim';
+import type { Subscription } from 'types/subscription';
+import FileDownloadLink from 'component/fileDownloadLink';
type Props = {
claim: Claim,
@@ -42,7 +44,7 @@ type Props = {
prepareEdit: ({}) => void,
setClientSetting: (string, boolean | string) => void,
checkSubscription: ({ channelName: string, uri: string }) => void,
- subscriptions: Array<{}>,
+ subscriptions: Array,
};
class FilePage extends React.Component {
@@ -151,11 +153,6 @@ class FilePage extends React.Component {
) : (
)}
- {!isPlaying && (
-
-
-
- )}
{title}
@@ -171,6 +168,7 @@ class FilePage extends React.Component
{
{metadata.nsfw && NSFW
}
+
{claimIsMine ? (
{
+
+
+
+
+
diff --git a/src/renderer/scss/component/_card.scss b/src/renderer/scss/component/_card.scss
index 84e74d3e2..9d5404e42 100644
--- a/src/renderer/scss/component/_card.scss
+++ b/src/renderer/scss/component/_card.scss
@@ -2,7 +2,6 @@
margin-left: auto;
margin-right: auto;
border-radius: var(--card-radius);
- overflow: auto;
user-select: text;
display: flex;
position: relative;
@@ -184,6 +183,10 @@
margin-top: $spacing-vertical * 2/3;
}
+.card__content--extra-padding {
+ margin-top: $spacing-vertical;
+}
+
.card__subtext-title {
color: var(--text-color);
font-size: calc(var(--font-size-subtext-multiple) * 1.5em);
diff --git a/src/renderer/scss/component/_file-download.scss b/src/renderer/scss/component/_file-download.scss
index c4bd7e025..b38d8a520 100644
--- a/src/renderer/scss/component/_file-download.scss
+++ b/src/renderer/scss/component/_file-download.scss
@@ -1,26 +1,3 @@
-.file-download,
-.file-download__overlay {
- padding: 5px;
-}
-
.file-download {
- position: relative;
- background-color: var(--color-black);
- border-radius: var(--btn-radius);
- color: var(--color-download);
- font-size: 12px;
- opacity: 0.8;
- font-family: 'metropolis-medium';
-}
-
-.file-download__overlay {
- background: var(--color-download);
- color: var(--color-download-overlay);
- border-radius: var(--btn-radius);
- position: absolute;
- white-space: nowrap;
- overflow: hidden;
- z-index: 1;
- top: 0px;
- left: 0px;
+ font-size: 0.8em;
}
--
2.43.4
From 7c4e4c24ad326972f9a58d5157f20ebf71bd03d8 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Mon, 21 May 2018 22:10:47 -0400
Subject: [PATCH 05/10] update lbry redux
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index d279738d6..3337b697d 100644
--- a/package.json
+++ b/package.json
@@ -48,7 +48,7 @@
"formik": "^0.10.4",
"hast-util-sanitize": "^1.1.2",
"keytar": "^4.2.1",
- "lbry-redux": "lbryio/lbry-redux#30c18725d8c6c141c30c57f0a324d0abb8963b99",
+ "lbry-redux": "lbryio/lbry-redux#c41899e78415cae6fcb7bfca0e6ba48bb6bfe6c4",
"localforage": "^1.7.1",
"mixpanel-browser": "^2.17.1",
"moment": "^2.22.0",
--
2.43.4
From f86bb14591fa6fdfc60fe08363c067cdf545c403 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Tue, 22 May 2018 20:11:20 -0400
Subject: [PATCH 06/10] update tooltip component to show on hover and add
different directions
---
src/renderer/component/categoryList/view.jsx | 1 +
src/renderer/component/common/icon.jsx | 35 +++++-
src/renderer/component/common/tooltip.jsx | 70 +++++-------
src/renderer/component/fileCard/view.jsx | 8 +-
src/renderer/page/file/view.jsx | 2 +-
src/renderer/page/search/view.jsx | 9 +-
src/renderer/scss/_gui.scss | 3 +-
src/renderer/scss/_vars.scss | 5 +-
src/renderer/scss/component/_card.scss | 51 ++++-----
src/renderer/scss/component/_tooltip.scss | 109 +++++++++++++++----
src/renderer/scss/mixin/link.scss | 28 -----
11 files changed, 181 insertions(+), 140 deletions(-)
delete mode 100644 src/renderer/scss/mixin/link.scss
diff --git a/src/renderer/component/categoryList/view.jsx b/src/renderer/component/categoryList/view.jsx
index 0afa57940..56c69f4c9 100644
--- a/src/renderer/component/categoryList/view.jsx
+++ b/src/renderer/component/categoryList/view.jsx
@@ -223,6 +223,7 @@ class CategoryList extends React.PureComponent {
{category &&
category.match(/^community/i) && (
{
- // TODO: Move all icons to constants and add titles for all
- // Add some some sort of hover flyout with the title?
-
+ getTooltip = (icon: string) => {
+ switch (icon) {
+ case icons.FEATURED:
+ return __('Featured content. Earn rewards for watching.');
+ case icons.LOCAL:
+ return __('This file is downloaded.');
+ default:
+ return null;
+ }
+ };
render() {
- const { icon } = this.props;
+ const { icon, tooltip } = this.props;
const Icon = FeatherIcons[icon];
+ if (!Icon) {
+ return null;
+ }
+
let color;
if (icon === icons.TRASH || icon === icons.FEATURED) {
color = RED_COLOR;
@@ -30,7 +43,19 @@ class IconComponent extends React.PureComponent {
size = 20;
}
- return Icon ? : null;
+ let tooltipText;
+ if (tooltip) {
+ tooltipText = this.getTooltip(icon);
+ }
+ const inner = ;
+
+ return tooltip ? (
+
+ {inner}
+
+ ) : (
+ inner
+ );
}
}
diff --git a/src/renderer/component/common/tooltip.jsx b/src/renderer/component/common/tooltip.jsx
index e226a8351..f1c5ca893 100644
--- a/src/renderer/component/common/tooltip.jsx
+++ b/src/renderer/component/common/tooltip.jsx
@@ -1,55 +1,41 @@
// @flow
-import React from 'react';
+import * as React from 'react';
import classnames from 'classnames';
-import Icon from 'component/common/icon';
-import Button from 'component/button';
-import * as icons from 'constants/icons';
type Props = {
- body: string,
- label: string,
+ body: ?string,
+ label?: string,
+ children: ?React.Node,
+ icon: ?boolean,
+ direction: string,
};
-type State = {
- showTooltip: boolean,
-};
-
-class ToolTip extends React.PureComponent {
- constructor(props: Props) {
- super(props);
-
- this.state = {
- showTooltip: false,
- };
-
- (this: any).handleClick = this.handleClick.bind(this);
- }
-
- handleClick() {
- const { showTooltip } = this.state;
-
- if (!showTooltip) {
- document.addEventListener('click', this.handleClick);
- } else {
- document.removeEventListener('click', this.handleClick);
- }
-
- this.setState({
- showTooltip: !showTooltip,
- });
- }
+class ToolTip extends React.PureComponent {
+ static defaultProps = {
+ direction: 'top',
+ };
render() {
- const { label, body } = this.props;
- const { showTooltip } = this.state;
+ const { children, label, body, icon, direction } = this.props;
+
+ const tooltipContent = children || label;
return (
-
-
- {label}
- {showTooltip && }
-
- {body}
+
+ {tooltipContent}
+ {body && (
+ // body may be undefined for some icons until we add messages for them
+ {body}
+ )}
);
}
diff --git a/src/renderer/component/fileCard/view.jsx b/src/renderer/component/fileCard/view.jsx
index 88bb99946..460006f70 100644
--- a/src/renderer/component/fileCard/view.jsx
+++ b/src/renderer/component/fileCard/view.jsx
@@ -98,14 +98,16 @@ class FileCard extends React.PureComponent {
{title}
-
+
{pending ? (
Pending...
) : (
- {isRewardContent && }
- {fileInfo && }
+
+ {isRewardContent && }
+ {fileInfo && }
+
)}
diff --git a/src/renderer/page/file/view.jsx b/src/renderer/page/file/view.jsx
index f6bec07aa..55a85904a 100644
--- a/src/renderer/page/file/view.jsx
+++ b/src/renderer/page/file/view.jsx
@@ -158,7 +158,7 @@ class FilePage extends React.Component
{
{title}
- {isRewardContent && }
+ {isRewardContent && }
diff --git a/src/renderer/page/search/view.jsx b/src/renderer/page/search/view.jsx
index 0535c34d7..763848def 100644
--- a/src/renderer/page/search/view.jsx
+++ b/src/renderer/page/search/view.jsx
@@ -5,6 +5,8 @@ import FileTile from 'component/fileTile';
import FileListSearch from 'component/fileListSearch';
import ToolTip from 'component/common/tooltip';
import Page from 'component/page';
+import Icon from 'component/common/icon';
+import * as icons from 'constants/icons';
const MODAL_ANIMATION_TIME = 250;
@@ -50,10 +52,11 @@ class SearchPage extends React.PureComponent {
{__('Exact URL')}
+ >
+
+
diff --git a/src/renderer/scss/_gui.scss b/src/renderer/scss/_gui.scss
index d49071623..0ad4197dc 100644
--- a/src/renderer/scss/_gui.scss
+++ b/src/renderer/scss/_gui.scss
@@ -122,12 +122,11 @@ input::placeholder {
}
select {
- min-width: 100px;
+ min-width: 60px;
height: 30px;
border-radius: 8px;
background-color: var(--input-select-bg-color);
font: normal 12px/30px 'metropolis-medium';
- text-indent: 12px;
color: var(--input-select-color);
&:disabled {
diff --git a/src/renderer/scss/_vars.scss b/src/renderer/scss/_vars.scss
index ea591571e..db8bf3e9e 100644
--- a/src/renderer/scss/_vars.scss
+++ b/src/renderer/scss/_vars.scss
@@ -161,9 +161,8 @@ $large-breakpoint: 1760px;
--modal-btn-bg-color: var(--btn-bg-alt);
// /* Tooltip */
- --tooltip-width: 300px;
- --tooltip-bg: var(--color-bg);
- --tooltip-color: var(--text-color);
+ --tooltip-bg: #555;
+ --tooltip-color: var(--color-white);
/* Scrollbar */
--scrollbar-radius: 10px;
diff --git a/src/renderer/scss/component/_card.scss b/src/renderer/scss/component/_card.scss
index 9d5404e42..b872a95e0 100644
--- a/src/renderer/scss/component/_card.scss
+++ b/src/renderer/scss/component/_card.scss
@@ -17,7 +17,6 @@
.card--small {
width: var(--card-small-width);
- overflow-x: hidden;
white-space: normal;
.card__media {
@@ -86,8 +85,7 @@
align-items: center;
.credit-amount,
.icon {
- margin-top: $spacing-vertical * 1/3;
- margin-left: $spacing-vertical * 2/3;
+ margin: $spacing-vertical * 1/3;
}
}
@@ -126,7 +124,11 @@
color: var(--card-text-color);
.icon {
- margin-left: $spacing-vertical * 1/3;
+ margin-top: $spacing-vertical * 1/6;
+
+ &:not(:first-of-type) {
+ margin: 0 $spacing-vertical * 1/3;
+ }
}
}
@@ -134,11 +136,6 @@
padding-top: $spacing-vertical * 1/3;
}
-.card__subtitle--file-info {
- display: flex;
- align-items: center;
-}
-
.card__subtitle--block {
display: block;
}
@@ -243,12 +240,11 @@
}
/*
- .card-row is used on the discover/subscriptions page
+ .card-row is used on the discover page
It is a list of cards that extend past the right edge of the screen
There are left/right arrows to scroll the cards and view hidden content
*/
.card-row {
- overflow: hidden;
white-space: nowrap;
width: 100%;
min-width: var(--card-small-width);
@@ -289,6 +285,18 @@
padding-top: $spacing-vertical * 2/3;
overflow: hidden;
+ .card {
+ display: inline-block;
+ vertical-align: top;
+ overflow-y: visible;
+ // 31 px to handle to padding between cards
+ width: calc((100% / 4) - 31px);
+ }
+
+ .card:not(:first-of-type) {
+ margin-left: 20px;
+ }
+
.card:first-of-type {
margin-left: $spacing-width;
}
@@ -327,27 +335,6 @@
}
}
-.card-row__scrollhouse {
- padding-top: $spacing-vertical * 2/3;
- overflow: hidden;
-
- .card {
- display: inline-block;
- vertical-align: top;
- overflow: visible;
- // 31 px to handle to padding between cards
- width: calc((100% / 4) - 31px);
- }
-
- .card:not(:first-of-type) {
- margin-left: 20px;
- }
-
- .card:last-of-type {
- margin-right: 20px;
- }
-}
-
.card__success-msg {
border-left: 2px solid var(--success-msg-border);
color: var(--success-msg-color);
diff --git a/src/renderer/scss/component/_tooltip.scss b/src/renderer/scss/component/_tooltip.scss
index 504880b09..3e32a7fbe 100644
--- a/src/renderer/scss/component/_tooltip.scss
+++ b/src/renderer/scss/component/_tooltip.scss
@@ -1,30 +1,97 @@
-@import '../mixin/link.scss';
-
.tooltip {
position: relative;
- padding: 0 $spacing-vertical / 3;
- font-size: 12px;
+ display: inline-block;
}
-.tooltip__body {
+// When there is a label for the tooltip and not just using a button or icon
+.tooltip.tooltip--label {
+ font-size: 12px;
+ padding-left: $spacing-vertical * 1/3;
+
+ .tooltip__body {
+ margin-top: 5px;
+ }
+}
+
+.tooltip.tooltip--icon {
+ margin-top: 5px;
+}
+
+/* Tooltip text */
+.tooltip .tooltip__body {
+ background-color: var(--tooltip-bg);
+ font-family: 'metropolis-medium';
+ font-size: 12px;
+ color: var(--tooltip-color);
+ border-radius: 8px;
position: absolute;
z-index: 1;
- left: 50%;
- margin-left: calc(var(--tooltip-width) * -1 / 2);
- white-space: normal;
- box-sizing: border-box;
- padding: $spacing-vertical / 2;
- width: var(--tooltip-width);
- color: var(--tooltip-color);
- background-color: var(--tooltip-bg);
- font-size: calc(var(--font-size) * 7 / 8);
- line-height: var(--font-line-height);
- box-shadow: var(--box-shadow-layer);
- border-radius: var(--card-radius);
+ width: 200px;
+ text-align: center;
+ white-space: pre-wrap;
+ padding: $spacing-vertical * 1/3;
+ visibility: hidden;
}
-.tooltip__link {
- font-size: calc(var(--font-size) * 3 / 4);
- margin-left: var(--button-padding);
- vertical-align: middle;
+.tooltip .tooltip__body::after {
+ content: ' ';
+ width: 0;
+ height: 0;
+ position: absolute;
+ border-width: 5px;
+ border-style: solid;
+}
+
+.tooltip.tooltip--top .tooltip__body {
+ bottom: 100%;
+ left: 50%;
+ margin-left: -100px;
+
+ &::after {
+ top: 100%;
+ left: 50%;
+ margin-left: -5px;
+ border-color: var(--tooltip-bg) transparent transparent transparent;
+ }
+}
+
+.tooltip.tooltip--right .tooltip__body {
+ margin-top: -5px;
+ margin-left: 10px;
+
+ &::after {
+ top: 17px;
+ right: 100%; /* To the left of the tooltip */
+ margin-top: -5px;
+ border-color: transparent var(--tooltip-bg) transparent transparent;
+ }
+}
+
+.tooltip.tooltip--bottom .tooltip__body {
+ top: 90%;
+ left: 50%;
+ margin-left: -100px;
+
+ &::after {
+ bottom: 100%;
+ left: 50%;
+ margin-left: -5px;
+ border-color: transparent transparent var(--tooltip-bg) transparent;
+ }
+}
+
+.tooltip.tooltip--left .tooltip__body {
+ top: -5px;
+ right: 105%;
+
+ &::after {
+ top: 17px;
+ left: 100%;
+ margin-top: -5px;
+ border-color: transparent transparent transparent var(--tooltip-bg);
+ }
+}
+
+.tooltip:hover .tooltip__body {
+ visibility: visible;
}
diff --git a/src/renderer/scss/mixin/link.scss b/src/renderer/scss/mixin/link.scss
deleted file mode 100644
index df55e49ba..000000000
--- a/src/renderer/scss/mixin/link.scss
+++ /dev/null
@@ -1,28 +0,0 @@
-@mixin text-link($color: var(--color-primary), $hover-opacity: 0.7) {
- .icon {
- &:first-child {
- padding-right: 5px;
- }
- &:last-child:not(:only-child) {
- padding-left: 5px;
- }
- }
-
- &:not(.no-underline) {
- text-decoration: underline;
- .icon {
- text-decoration: none;
- }
- }
- &:hover {
- opacity: $hover-opacity;
- transition: opacity var(--transition-duration) var(--transition-type);
- text-decoration: underline;
- .icon {
- text-decoration: none;
- }
- }
-
- color: $color;
- cursor: pointer;
-}
--
2.43.4
From 2f4395a9e3582d295cef7a20a738b2642def3c95 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Tue, 22 May 2018 20:29:29 -0400
Subject: [PATCH 07/10] cleanup FileDownloadLink
---
.../component/fileDownloadLink/index.js | 2 --
.../component/fileDownloadLink/view.jsx | 27 ++++---------------
2 files changed, 5 insertions(+), 24 deletions(-)
diff --git a/src/renderer/component/fileDownloadLink/index.js b/src/renderer/component/fileDownloadLink/index.js
index d36f4c896..22f4f0a3f 100644
--- a/src/renderer/component/fileDownloadLink/index.js
+++ b/src/renderer/component/fileDownloadLink/index.js
@@ -5,7 +5,6 @@ import {
makeSelectLoadingForUri,
makeSelectCostInfoForUri,
} from 'lbry-redux';
-import { doFetchAvailability } from 'redux/actions/availability';
import { doOpenFileInShell } from 'redux/actions/file';
import { doPurchaseUri, doStartDownload } from 'redux/actions/content';
import { doPause } from 'redux/actions/media';
@@ -20,7 +19,6 @@ const select = (state, props) => ({
});
const perform = dispatch => ({
- checkAvailability: uri => dispatch(doFetchAvailability(uri)),
openInShell: path => dispatch(doOpenFileInShell(path)),
purchaseUri: uri => dispatch(doPurchaseUri(uri)),
restartDownload: (uri, outpoint) => dispatch(doStartDownload(uri, outpoint)),
diff --git a/src/renderer/component/fileDownloadLink/view.jsx b/src/renderer/component/fileDownloadLink/view.jsx
index 0658ae253..8acc17db3 100644
--- a/src/renderer/component/fileDownloadLink/view.jsx
+++ b/src/renderer/component/fileDownloadLink/view.jsx
@@ -11,31 +11,19 @@ type Props = {
total_bytes: number,
outpoint: number,
download_path: string,
+ completed: boolean,
},
loading: boolean,
costInfo: ?{},
restartDownload: (string, number) => void,
- checkAvailability: string => void,
openInShell: string => void,
purchaseUri: string => void,
doPause: () => void,
};
class FileDownloadLink extends React.PureComponent {
- componentWillMount() {
- this.checkAvailability(this.props.uri);
- }
-
- componentWillReceiveProps(nextProps: Props) {
- this.checkAvailability(nextProps.uri);
- this.restartDownload(nextProps);
- }
-
- uri: ?string;
-
- restartDownload = (props: Props) => {
- const { downloading, fileInfo, uri, restartDownload } = props;
-
+ componentWillUpdate() {
+ const { downloading, fileInfo, uri, restartDownload } = this.props;
if (
!downloading &&
fileInfo &&
@@ -45,15 +33,10 @@ class FileDownloadLink extends React.PureComponent {
) {
restartDownload(uri, fileInfo.outpoint);
}
- };
-
- checkAvailability(uri: string) {
- if (!this.uri || uri !== this.uri) {
- this.uri = uri;
- this.props.checkAvailability(uri);
- }
}
+ uri: ?string;
+
render() {
const {
fileInfo,
--
2.43.4
From e56c21fd22d73afa4be1922e5404545c005a25f8 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Tue, 22 May 2018 23:48:22 -0400
Subject: [PATCH 08/10] use color prop for icon color instead of relying on
type of icon and tooltip cleanup
---
src/renderer/component/button/view.jsx | 6 +++--
src/renderer/component/categoryList/view.jsx | 1 -
src/renderer/component/common/icon.jsx | 23 ++++++++++++++-----
src/renderer/component/common/tooltip.jsx | 9 +++-----
src/renderer/component/fileActions/view.jsx | 1 +
src/renderer/component/fileCard/view.jsx | 2 +-
.../component/fileDownloadLink/view.jsx | 9 +++++++-
.../component/subscribeButton/view.jsx | 3 ++-
src/renderer/page/file/view.jsx | 4 ++--
src/renderer/scss/component/_file-list.scss | 4 ++++
10 files changed, 42 insertions(+), 20 deletions(-)
diff --git a/src/renderer/component/button/view.jsx b/src/renderer/component/button/view.jsx
index f622ff28a..8b496ea12 100644
--- a/src/renderer/component/button/view.jsx
+++ b/src/renderer/component/button/view.jsx
@@ -22,6 +22,7 @@ type Props = {
button: ?string, // primary, secondary, alt, link
noPadding: ?boolean, // to remove padding and allow circular buttons
uppercase: ?boolean,
+ iconColor: ?string,
};
class Button extends React.PureComponent {
@@ -48,6 +49,7 @@ class Button extends React.PureComponent {
type,
noPadding,
uppercase,
+ iconColor,
...otherProps
} = this.props;
@@ -82,10 +84,10 @@ class Button extends React.PureComponent {
const content = (
- {icon && }
+ {icon && }
{label && {label} }
{children && children}
- {iconRight && }
+ {iconRight && }
);
diff --git a/src/renderer/component/categoryList/view.jsx b/src/renderer/component/categoryList/view.jsx
index 56c69f4c9..0afa57940 100644
--- a/src/renderer/component/categoryList/view.jsx
+++ b/src/renderer/component/categoryList/view.jsx
@@ -223,7 +223,6 @@ class CategoryList extends React.PureComponent {
{category &&
category.match(/^community/i) && (
{
@@ -23,8 +24,20 @@ class IconComponent extends React.PureComponent {
return null;
}
};
+
+ getIconColor = (color: string) => {
+ switch (color) {
+ case 'red':
+ return RED_COLOR;
+ case 'purple':
+ return PURPLE_COLOR;
+ default:
+ return null;
+ }
+ };
+
render() {
- const { icon, tooltip } = this.props;
+ const { icon, tooltip, iconColor } = this.props;
const Icon = FeatherIcons[icon];
if (!Icon) {
@@ -32,10 +45,8 @@ class IconComponent extends React.PureComponent {
}
let color;
- if (icon === icons.TRASH || icon === icons.FEATURED) {
- color = RED_COLOR;
- } else if (icon === icons.OPEN) {
- color = PURPLE_COLOR;
+ if (iconColor) {
+ color = this.getIconColor(iconColor);
}
let size = 14;
diff --git a/src/renderer/component/common/tooltip.jsx b/src/renderer/component/common/tooltip.jsx
index f1c5ca893..4bd264516 100644
--- a/src/renderer/component/common/tooltip.jsx
+++ b/src/renderer/component/common/tooltip.jsx
@@ -3,7 +3,7 @@ import * as React from 'react';
import classnames from 'classnames';
type Props = {
- body: ?string,
+ body: string,
label?: string,
children: ?React.Node,
icon: ?boolean,
@@ -12,7 +12,7 @@ type Props = {
class ToolTip extends React.PureComponent {
static defaultProps = {
- direction: 'top',
+ direction: 'bottom',
};
render() {
@@ -32,10 +32,7 @@ class ToolTip extends React.PureComponent {
})}
>
{tooltipContent}
- {body && (
- // body may be undefined for some icons until we add messages for them
- {body}
- )}
+ {body}
);
}
diff --git a/src/renderer/component/fileActions/view.jsx b/src/renderer/component/fileActions/view.jsx
index a485cc90e..4ab110fca 100644
--- a/src/renderer/component/fileActions/view.jsx
+++ b/src/renderer/component/fileActions/view.jsx
@@ -30,6 +30,7 @@ class FileActions extends React.PureComponent {
openModal({ id: MODALS.CONFIRM_FILE_REMOVE }, { uri })}
/>
diff --git a/src/renderer/component/fileCard/view.jsx b/src/renderer/component/fileCard/view.jsx
index 460006f70..eae87deaa 100644
--- a/src/renderer/component/fileCard/view.jsx
+++ b/src/renderer/component/fileCard/view.jsx
@@ -105,7 +105,7 @@ class FileCard extends React.PureComponent {
- {isRewardContent && }
+ {isRewardContent && }
{fileInfo && }
diff --git a/src/renderer/component/fileDownloadLink/view.jsx b/src/renderer/component/fileDownloadLink/view.jsx
index 8acc17db3..8d96624f8 100644
--- a/src/renderer/component/fileDownloadLink/view.jsx
+++ b/src/renderer/component/fileDownloadLink/view.jsx
@@ -76,6 +76,7 @@ class FileDownloadLink extends React.PureComponent {
button="alt"
label={__('Download')}
icon={icons.DOWNLOAD}
+ iconColor="purple"
onClick={() => {
purchaseUri(uri);
}}
@@ -83,7 +84,13 @@ class FileDownloadLink extends React.PureComponent {
);
} else if (fileInfo && fileInfo.download_path) {
return (
- openFile()} />
+ openFile()}
+ />
);
}
diff --git a/src/renderer/component/subscribeButton/view.jsx b/src/renderer/component/subscribeButton/view.jsx
index 5366d107a..a29b8bb4a 100644
--- a/src/renderer/component/subscribeButton/view.jsx
+++ b/src/renderer/component/subscribeButton/view.jsx
@@ -37,8 +37,9 @@ export default (props: Props) => {
return channelName && uri ? (
{
if (!subscriptions.length) {
diff --git a/src/renderer/page/file/view.jsx b/src/renderer/page/file/view.jsx
index 55a85904a..4071e9125 100644
--- a/src/renderer/page/file/view.jsx
+++ b/src/renderer/page/file/view.jsx
@@ -41,7 +41,7 @@ type Props = {
openModal: ({ id: string }, { uri: string }) => void,
fetchFileInfo: string => void,
fetchCostInfo: string => void,
- prepareEdit: ({}) => void,
+ prepareEdit: ({}, string) => void,
setClientSetting: (string, boolean | string) => void,
checkSubscription: ({ channelName: string, uri: string }) => void,
subscriptions: Array,
@@ -158,7 +158,7 @@ class FilePage extends React.Component {
{title}
- {isRewardContent && }
+ {isRewardContent && }
diff --git a/src/renderer/scss/component/_file-list.scss b/src/renderer/scss/component/_file-list.scss
index 72cee988f..30b2de303 100644
--- a/src/renderer/scss/component/_file-list.scss
+++ b/src/renderer/scss/component/_file-list.scss
@@ -14,6 +14,10 @@
.file-list__header {
margin-top: $spacing-vertical * 4/3;
font-size: 18px;
+
+ .tooltip {
+ margin-left: 5px;
+ }
}
.file-tile {
--
2.43.4
From 1a6188a7c7bb257c37378373513d4ff06ab962ce Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Tue, 22 May 2018 23:55:11 -0400
Subject: [PATCH 09/10] fix select background color for dark mode
---
static/themes/dark.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/static/themes/dark.css b/static/themes/dark.css
index dc4d666b7..9bf8cac02 100644
--- a/static/themes/dark.css
+++ b/static/themes/dark.css
@@ -29,7 +29,7 @@
--input-copyable-bg: var(--color-blue-grey);
--input-copyable-color: #8696AF;
--input-copyable-border: #53637C;
- --input-select-bg-color: var(--color-blue-grey);
+ --input-select-bg-color: var(--color-bg-alt);
--input-select-color: var(--color-white);
/* input:disabled */
--
2.43.4
From 37b04993da78c30410b7b38e6bfc671fe2baaf17 Mon Sep 17 00:00:00 2001
From: Sean Yesmunt
Date: Fri, 25 May 2018 00:36:43 -0400
Subject: [PATCH 10/10] use classname for select styling
---
.eslintrc.json | 3 ++-
.../common/form-components/form-field-price.jsx | 1 -
.../component/common/form-components/form-field.jsx | 2 +-
src/renderer/scss/_gui.scss | 13 -------------
src/renderer/scss/component/_form-field.scss | 13 +++++++++++++
yarn.lock | 4 ++--
6 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/.eslintrc.json b/.eslintrc.json
index 83b2a0606..d3bcd1f7b 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -36,6 +36,7 @@
"func-names": ["warn", "as-needed"],
"jsx-a11y/label-has-for": 0,
"import/prefer-default-export": 0,
- "no-return-assign": 0
+ "no-return-assign": 0,
+ "react/require-default-props": 0
}
}
diff --git a/src/renderer/component/common/form-components/form-field-price.jsx b/src/renderer/component/common/form-components/form-field-price.jsx
index d8fcd2120..eceeb94a7 100644
--- a/src/renderer/component/common/form-components/form-field-price.jsx
+++ b/src/renderer/component/common/form-components/form-field-price.jsx
@@ -62,7 +62,6 @@ export class FormFieldPrice extends React.PureComponent {
name={`${name}_currency`}
type="select"
id={`${name}_currency`}
- className="form-field"
disabled={disabled}
onChange={this.handleCurrencyChange}
value={price.currency}
diff --git a/src/renderer/component/common/form-components/form-field.jsx b/src/renderer/component/common/form-components/form-field.jsx
index ffbc7eabc..441646447 100644
--- a/src/renderer/component/common/form-components/form-field.jsx
+++ b/src/renderer/component/common/form-components/form-field.jsx
@@ -42,7 +42,7 @@ export class FormField extends React.PureComponent {
if (type) {
if (type === 'select') {
input = (
-
+
{children}
);
diff --git a/src/renderer/scss/_gui.scss b/src/renderer/scss/_gui.scss
index 0ad4197dc..e7266b68b 100644
--- a/src/renderer/scss/_gui.scss
+++ b/src/renderer/scss/_gui.scss
@@ -121,19 +121,6 @@ input::placeholder {
opacity: 0.5;
}
-select {
- min-width: 60px;
- height: 30px;
- border-radius: 8px;
- background-color: var(--input-select-bg-color);
- font: normal 12px/30px 'metropolis-medium';
- color: var(--input-select-color);
-
- &:disabled {
- opacity: 0.5;
- }
-}
-
button + input {
margin-left: $spacing-vertical * 2/3;
}
diff --git a/src/renderer/scss/component/_form-field.scss b/src/renderer/scss/component/_form-field.scss
index 406318e8e..8b814dbf0 100644
--- a/src/renderer/scss/component/_form-field.scss
+++ b/src/renderer/scss/component/_form-field.scss
@@ -100,6 +100,19 @@
padding-left: $spacing-vertical * 1/3;
}
+.form-field__select {
+ min-width: 60px;
+ height: 30px;
+ border-radius: 8px;
+ background-color: var(--input-select-bg-color);
+ font: normal 12px/30px 'metropolis-medium';
+ color: var(--input-select-color);
+
+ &:disabled {
+ opacity: 0.5;
+ }
+}
+
// Not sure if I like these
// Maybe this should be in gui.scss?
.input--price-amount {
diff --git a/yarn.lock b/yarn.lock
index ffa56a39f..27fb511b0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5837,9 +5837,9 @@ lazy-val@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/lazy-val/-/lazy-val-1.0.3.tgz#bb97b200ef00801d94c317e29dc6ed39e31c5edc"
-lbry-redux@lbryio/lbry-redux#30c18725d8c6c141c30c57f0a324d0abb8963b99:
+lbry-redux@lbryio/lbry-redux#c41899e78415cae6fcb7bfca0e6ba48bb6bfe6c4:
version "0.0.1"
- resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/30c18725d8c6c141c30c57f0a324d0abb8963b99"
+ resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/c41899e78415cae6fcb7bfca0e6ba48bb6bfe6c4"
dependencies:
proxy-polyfill "0.1.6"
reselect "^3.0.0"
--
2.43.4