Style improvements and user history bugs #1999

Merged
neb-b merged 4 commits from history-improvements into master 2018-10-05 19:47:52 +02:00
17 changed files with 100 additions and 106 deletions

View file

@ -40,6 +40,8 @@
"react/require-default-props": 0, "react/require-default-props": 0,
"react/jsx-closing-tag-location": 0, "react/jsx-closing-tag-location": 0,
"jsx-a11y/no-noninteractive-element-to-interactive-role": 0, "jsx-a11y/no-noninteractive-element-to-interactive-role": 0,
"class-methods-use-this": 0 "class-methods-use-this": 0,
"jsx-a11y/interactive-supports-focus": 0,
"jsx-a11y/click-events-have-key-events": 0
} }
} }

View file

@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
### Fixed ### Fixed
* Invite table cutoff with large number of invites ([#1985](https://github.com/lbryio/lbry-desktop/pull/1985)) * Invite table cutoff with large number of invites ([#1985](https://github.com/lbryio/lbry-desktop/pull/1985))
* History styling on large screens and link issue with claims ([#1999](https://github.com/lbryio/lbry-desktop/pull/1999))
## [0.25.1] - 2018-09-18 ## [0.25.1] - 2018-09-18

View file

@ -24,6 +24,10 @@ class TransactionListRecent extends React.PureComponent<Props> {
return ( return (
<section className="card card--section"> <section className="card card--section">
<div className="card__title">{__('Recent Transactions')}</div> <div className="card__title">{__('Recent Transactions')}</div>
<div className="card__subtitle">
{__('To view all of your transactions, navigate to the')}{' '}
<Button button="link" navigate="/history" label={__('transactions page')} />.
</div>
{fetchingTransactions && ( {fetchingTransactions && (
<div className="card__content"> <div className="card__content">
<BusyIndicator message={__('Loading transactions')} /> <BusyIndicator message={__('Loading transactions')} />

View file

@ -99,7 +99,8 @@ class UserHistoryPage extends React.PureComponent<Props, State> {
const allSelected = Object.keys(itemsSelected).length === history.length; const allSelected = Object.keys(itemsSelected).length === history.length;
const selectHandler = allSelected ? this.unselectAll : this.selectAll; const selectHandler = allSelected ? this.unselectAll : this.selectAll;
return (
return history.length ? (
<React.Fragment> <React.Fragment>
<div className="card__actions card__actions--between"> <div className="card__actions card__actions--between">
{Object.keys(itemsSelected).length ? ( {Object.keys(itemsSelected).length ? (
@ -109,7 +110,6 @@ class UserHistoryPage extends React.PureComponent<Props, State> {
{/* Using an empty span so spacing stays the same if the button isn't rendered */} {/* Using an empty span so spacing stays the same if the button isn't rendered */}
</span> </span>
)} )}
<Button <Button
button="link" button="link"
label={allSelected ? __('Cancel') : __('Select All')} label={allSelected ? __('Cancel') : __('Select All')}
@ -117,8 +117,7 @@ class UserHistoryPage extends React.PureComponent<Props, State> {
/> />
</div> </div>
{!!history.length && ( {!!history.length && (
<table className="card--section table table--stretch table--history"> <section className="item-list">
<tbody>
{history.map(item => ( {history.map(item => (
<UserHistoryItem <UserHistoryItem
key={item.uri} key={item.uri}
@ -130,8 +129,7 @@ class UserHistoryPage extends React.PureComponent<Props, State> {
}} }}
/> />
))} ))}
</tbody> </section>
</table>
)} )}
{pageCount > 1 && ( {pageCount > 1 && (
<FormRow padded verticallyCentered centered> <FormRow padded verticallyCentered centered>
@ -161,6 +159,13 @@ class UserHistoryPage extends React.PureComponent<Props, State> {
</FormRow> </FormRow>
)} )}
</React.Fragment> </React.Fragment>
) : (
<div className="page__empty">
{__("You don't have anything saved in history yet, go check out some content on LBRY!")}
<div className="card__actions card__actions--center">
<Button button="primary" navigate="/discover" label={__('Explore new content')} />
</div>
</div>
); );
} }
} }

View file

@ -36,18 +36,16 @@ class UserHistoryItem extends React.PureComponent<Props> {
} }
return ( return (
<tr <div
role="button"
onClick={onSelect} onClick={onSelect}
className={classnames({ className={classnames('item-list__item', {
history__selected: selected, 'item-list__item--selected': selected,
})} })}
> >
<td>
<input checked={selected} type="checkbox" onClick={onSelect} /> <input checked={selected} type="checkbox" onClick={onSelect} />
</td> <span className="time time--ago">{moment(lastViewed).from(moment())}</span>
<td>{moment(lastViewed).from(moment())}</td> <span className="item-list__item--cutoff">{title}</span>
<td>{title}</td>
<td>
<Button <Button
tourniquet tourniquet
button="link" button="link"
@ -55,8 +53,7 @@ class UserHistoryItem extends React.PureComponent<Props> {
navigate="/show" navigate="/show"
navigateParams={{ uri }} navigateParams={{ uri }}
/> />
</td> </div>
</tr>
); );
} }
} }

View file

@ -199,7 +199,7 @@ class HelpPage extends React.PureComponent<Props, State> {
)} )}
{this.state.uiVersion && ver ? ( {this.state.uiVersion && ver ? (
<table className="table table--stretch table--help"> <table className="card__content table table--stretch table--help">
<tbody> <tbody>
<tr> <tr>
<td>{__('App')}</td> <td>{__('App')}</td>

View file

@ -8,6 +8,14 @@ export function doNavigate(path, params = {}, options = {}) {
return; return;
} }
// ensure uri always has "lbry://" prefix
const navigationParams = params;
if (path === '/show') {
if (navigationParams.uri && !navigationParams.uri.startsWith('lbry://')) {
navigationParams.uri = `lbry://${navigationParams.uri}`;
}
}
let url = path; let url = path;
if (params && Object.values(params).length) { if (params && Object.values(params).length) {
url += `?${toQueryString(params)}`; url += `?${toQueryString(params)}`;

View file

@ -39,7 +39,7 @@ html {
} }
body { body {
font-family: 'metropolis-semibold'; font-family: 'metropolis-medium';
font-weight: 400; font-weight: 400;
font-size: 16px; font-size: 16px;
line-height: 1.5; line-height: 1.5;
@ -74,7 +74,6 @@ input {
line-height: 1; line-height: 1;
cursor: text; cursor: text;
background-color: transparent; background-color: transparent;
font-family: 'metropolis-medium';
&[type='radio'], &[type='radio'],
&[type='checkbox'], &[type='checkbox'],
@ -109,7 +108,6 @@ input {
} }
textarea { textarea {
font-family: 'metropolis-medium';
border: 1px solid var(--color-divider); border: 1px solid var(--color-divider);
font-size: 0.8em; font-size: 0.8em;
width: 100%; width: 100%;
@ -152,8 +150,6 @@ dd {
} }
p { p {
font-family: 'metropolis-medium';
&:not(:first-of-type) { &:not(:first-of-type) {
margin-top: $spacing-vertical * 1/3; margin-top: $spacing-vertical * 1/3;
} }
@ -227,7 +223,6 @@ p {
.page__empty { .page__empty {
margin-top: 200px; margin-top: 200px;
text-align: center; text-align: center;
font-family: 'metropolis-medium';
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -300,7 +295,6 @@ p {
color: inherit; color: inherit;
font-weight: inherit; font-weight: inherit;
font-size: inherit; font-size: inherit;
font-family: 'metropolis-medium';
padding: 0; padding: 0;
} }
@ -333,10 +327,6 @@ p {
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.busy-indicator {
font-family: 'metropolis-medium';
}
.busy-indicator__loader { .busy-indicator__loader {
background: url('../../../static/img/busy.gif') no-repeat center center; background: url('../../../static/img/busy.gif') no-repeat center center;
display: inline-block; display: inline-block;
@ -355,7 +345,6 @@ p {
.help { .help {
font-size: 12px; font-size: 12px;
font-family: 'metropolis-medium';
color: var(--color-help); color: var(--color-help);
} }
@ -364,7 +353,6 @@ p {
} }
.meta { .meta {
font-family: 'metropolis-medium';
font-size: 0.8em; font-size: 0.8em;
color: var(--color-meta-light); color: var(--color-meta-light);
} }

View file

@ -52,6 +52,8 @@ $large-breakpoint: 1921px;
--color-search-placeholder: var(--color-placeholder); --color-search-placeholder: var(--color-placeholder);
--color-credit-free: var(--color-dark-blue); --color-credit-free: var(--color-dark-blue);
--color-credit-price: var(--card-text-color); --color-credit-price: var(--card-text-color);
--color-text-black: #444;
--color-text-white: #efefef;
/* Shadows */ /* Shadows */
--box-shadow-layer: transparent; // 0 2px 4px rgba(0,0,0,0.25); --box-shadow-layer: transparent; // 0 2px 4px rgba(0,0,0,0.25);
@ -60,8 +62,8 @@ $large-breakpoint: 1921px;
--box-shadow-header: 0px 6px 20px 1px rgba(0, 0, 0, 0.05); --box-shadow-header: 0px 6px 20px 1px rgba(0, 0, 0, 0.05);
/* Text */ /* Text */
--text-color: var(--color-black); --text-color: var(--color-text-black);
--text-color-inverse: var(--color-white); --text-color-inverse: var(--color-text-white);
--text-help-color: var(--color-help); --text-help-color: var(--color-help);
--text-max-width: 660px; --text-max-width: 660px;
--text-link-padding: 4px; --text-link-padding: 4px;

View file

@ -29,3 +29,5 @@
@import 'component/_toggle.scss'; @import 'component/_toggle.scss';
@import 'component/_search.scss'; @import 'component/_search.scss';
@import 'component/_dat-gui.scss'; @import 'component/_dat-gui.scss';
@import 'component/_item-list.scss';
@import 'component/_time.scss';

View file

@ -19,7 +19,6 @@ button:disabled {
fill: currentColor; // for proper icon color fill: currentColor; // for proper icon color
font-size: 12px; font-size: 12px;
transition: all var(--animation-duration) var(--animation-style); transition: all var(--animation-duration) var(--animation-style);
font-family: 'metropolis-medium';
&:not(:disabled) { &:not(:disabled) {
box-shadow: var(--box-shadow-button); box-shadow: var(--box-shadow-button);
@ -172,7 +171,6 @@ button:disabled {
} }
.btn.btn--header-balance { .btn.btn--header-balance {
font-family: 'metropolis-medium';
font-size: 14px; font-size: 14px;
color: var(--header-primary-color); color: var(--header-primary-color);

View file

@ -107,6 +107,7 @@
.card__title { .card__title {
font-size: 18px; font-size: 18px;
color: var(--text-color); color: var(--text-color);
font-family: 'metropolis-semibold';
} }
.card__title--small { .card__title--small {
@ -151,7 +152,6 @@
.card__subtitle { .card__subtitle {
margin: 0; margin: 0;
font-size: 14px; font-size: 14px;
font-family: 'metropolis-medium';
color: var(--card-text-color); color: var(--card-text-color);
} }
@ -336,6 +336,7 @@
} }
.card-row__title { .card-row__title {
font-family: 'metropolis-semibold';
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 18px; font-size: 18px;

View file

@ -0,0 +1,26 @@
.item-list {
background-color: var(--card-bg);
margin-top: $spacing-vertical;
}
.item-list__item {
display: flex;
align-items: center;
padding: $spacing-vertical * 1/3;
input,
.item-list__item--cutoff {
margin-right: $spacing-vertical;
}
}
.item-list__item--selected {
background-color: var(--table-item-odd);
}
.item-list__item--cutoff {
white-space: nowrap;
text-overflow: ellipsis;
overflow-x: hidden;
max-width: 350px;
}

View file

@ -24,7 +24,6 @@
padding: 10px; padding: 10px;
padding-left: 30px; padding-left: 30px;
font-size: 13px; font-size: 13px;
font-family: 'metropolis-medium';
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -54,7 +53,6 @@
flex-direction: row; flex-direction: row;
justify-items: flex-start; justify-items: flex-start;
align-items: center; align-items: center;
font-family: 'metropolis-medium';
&:not(:first-of-type) { &:not(:first-of-type) {
border-top: 1px solid var(--search-item-border-color); border-top: 1px solid var(--search-item-border-color);
@ -75,7 +73,6 @@
.wunderbar__suggestion-label--action { .wunderbar__suggestion-label--action {
margin-left: $spacing-vertical * 1/3; margin-left: $spacing-vertical * 1/3;
white-space: nowrap; white-space: nowrap;
font-family: 'metropolis-medium';
font-size: 12px; font-size: 12px;
line-height: 0.1; // to vertically align because the font size is smaller line-height: 0.1; // to vertically align because the font size is smaller
} }

View file

@ -3,7 +3,6 @@ table.table,
word-wrap: break-word; word-wrap: break-word;
max-width: 100%; max-width: 100%;
text-align: left; text-align: left;
margin-top: $spacing-vertical * 2/3;
tr td:first-of-type, tr td:first-of-type,
tr th:first-of-type { tr th:first-of-type {
@ -107,48 +106,3 @@ table.table--transactions {
width: 15%; width: 15%;
} }
} }
table.table--history {
margin-top: $spacing-vertical * 1/3;
tbody {
tr {
&:nth-child(even),
&:nth-child(odd) {
background-color: var(--table-item-even);
&.history__selected {
color: red;
background-color: var(--table-item-odd);
}
}
}
td {
cursor: default;
padding: $spacing-vertical * 1/3 0;
}
td:nth-of-type(1) {
width: 7.5%;
}
td:nth-of-type(2) {
width: 17.5%;
}
td:nth-of-type(3) {
width: 40%;
max-width: 30vw;
padding-right: $spacing-vertical * 2/3;
}
td:nth-of-type(4) {
width: 30%;
}
td:nth-of-type(3),
td:nth-of-type(4) {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}
}

View file

@ -0,0 +1,9 @@
// All CSS for date & time ui
.time {
color: var(--color-help);
}
.time--ago {
min-width: 160px;
}

View file

@ -12,7 +12,7 @@
--color-credit-free: var(--color-secondary); --color-credit-free: var(--color-secondary);
/* Text */ /* Text */
--text-color: var(--color-white); --text-color: var(--color-text-white);
--text-help-color: var(--color-help); --text-help-color: var(--color-help);
/* Form */ /* Form */