review changes

This commit is contained in:
jessop 2020-04-15 10:12:54 -04:00 committed by Sean Yesmunt
parent 6226a5a6b1
commit 24eb0c2aea
8 changed files with 17 additions and 25 deletions

View file

@ -130,7 +130,7 @@
"imagesloaded": "^4.1.4",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#cd3fa330663a21e21cb36f29104ab2a408d5412d",
"lbry-redux": "lbryio/lbry-redux#07dff852f1529c242bb830a26d9603f81ac00954",
"lbryinc": "lbryio/lbryinc#12aefaa14343d2f3eac01f2683701f58e53f1848",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",

View file

@ -1156,5 +1156,6 @@
"lbry": "lbry",
"Default": "Default",
"Amount (LBC)": "Amount (LBC)",
"Register": "Register"
}
"Register": "Register",
"Successfully unlocked your tip!": "Successfully unlocked your tip!"
}

View file

@ -412,7 +412,7 @@ function ClaimListDiscover(props: Props) {
className={classnames(`button-toggle button-toggle--top button-toggle--more`, {
'button-toggle--custom': isFiltered(),
})}
icon={toCapitalCase(ICONS.SLIDERS)}
icon={ICONS.SLIDERS}
onClick={() => setExpanded(!expanded)}
/>
)}

View file

@ -4,7 +4,6 @@ import React, { useState } from 'react';
import classnames from 'classnames';
import Icon from 'component/common/icon';
import Button from 'component/button';
import { toCapitalCase } from 'util/string';
import * as ICONS from 'constants/icons';
type Props = {
@ -57,7 +56,7 @@ export default function Card(props: Props) {
<Button
button={'alt'}
aria-label={__('More')}
icon={expanded ? toCapitalCase(ICONS.SUBTRACT) : toCapitalCase(ICONS.ADD)}
icon={expanded ? ICONS.SUBTRACT : ICONS.ADD}
onClick={() => setExpanded(!expanded)}
/>
</div>

View file

@ -182,7 +182,6 @@ function AppRouter(props: Props) {
<PrivateRoute {...props} path={`/$/${PAGES.CREATOR_DASHBOARD}`} component={CreatorDashboard} />
<PrivateRoute {...props} path={`/$/${PAGES.PUBLISH}`} component={PublishPage} />
<PrivateRoute {...props} path={`/$/${PAGES.REPORT}`} component={ReportPage} />
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS}`} component={RewardsPage} />
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS}`} exact component={RewardsPage} />
<PrivateRoute {...props} path={`/$/${PAGES.REWARDS_VERIFY}`} component={RewardsVerifyPage} />
<PrivateRoute {...props} path={`/$/${PAGES.LIBRARY}`} component={LibraryPage} />

View file

@ -6,6 +6,7 @@ import CreditAmount from 'component/common/credit-amount';
import DateTime from 'component/dateTime';
import Button from 'component/button';
import Spinner from 'component/spinner';
import { toCapitalCase } from 'util/string';
import { buildURI, parseURI, TXO_LIST as TXO, TXO_ABANDON_STATES as TXO_STATES } from 'lbry-redux';
type Props = {
@ -58,12 +59,9 @@ class TxoListItem extends React.PureComponent<Props, State> {
}
abandonClaim() {
this.props.revokeClaim(this.props.txo, st => this.setState({ abandonState: st }));
// this.setState({ disabled: true }); // just flag the item disabled
this.props.revokeClaim(this.props.txo, abandonState => this.setState({ abandonState }));
}
capitalize = (string: string) => string && string.charAt(0).toUpperCase() + string.slice(1);
render() {
const { reward, txo, isRevokeable } = this.props;
@ -75,7 +73,7 @@ class TxoListItem extends React.PureComponent<Props, State> {
txid,
type,
value_type: valueType,
is_my_input: isMyInput, // no transaction
is_my_input: isMyInput,
is_my_output: isMyOutput,
} = txo;
@ -121,9 +119,9 @@ class TxoListItem extends React.PureComponent<Props, State> {
</td>
<td className="table__item--actionable">
<span>
{(isTip && __(this.capitalize('tip'))) ||
(valueType && __(this.capitalize(valueType))) ||
(type && __(this.capitalize(type)))}
{(isTip && __(toCapitalCase('tip'))) ||
(valueType && __(toCapitalCase(valueType))) ||
(type && __(toCapitalCase(type)))}
</span>{' '}
{isRevokeable && this.getLink(type)}
</td>

View file

@ -28,7 +28,6 @@ type Delta = {
function TxoList(props: Props) {
const { search, txoPage, txoItemCount, fetchTxoPage, updateTxoPageParams, history } = props;
// parse urlParams
const urlParams = new URLSearchParams(search);
const page = urlParams.get(TXO.PAGE) || String(1);
const pageSize = urlParams.get(TXO.PAGE_SIZE) || String(TXO.PAGE_SIZE_DEFAULT);
@ -44,7 +43,6 @@ function TxoList(props: Props) {
subtype,
};
// build new json params
const params = {};
if (currentUrlParams.type) {
if (currentUrlParams.type === TXO.SENT) {
@ -174,7 +172,6 @@ function TxoList(props: Props) {
<div>
<div className="card__body-actions">
<div className="card__actions">
{/* show the main drop down */}
<div>
<FormField
type="select"
@ -193,7 +190,6 @@ function TxoList(props: Props) {
})}
</FormField>
</div>
{/* show the subtypes drop down */}
{(type === TXO.SENT || type === TXO.RECEIVED) && (
<div>
<FormField
@ -224,7 +220,7 @@ function TxoList(props: Props) {
className={classnames(`button-toggle`, {
'button-toggle--active': active === TXO.ACTIVE,
})}
label={__(toCapitalCase('active'))}
label={__('Active')}
/>
<Button
button="alt"
@ -232,7 +228,7 @@ function TxoList(props: Props) {
className={classnames(`button-toggle`, {
'button-toggle--active': active === 'spent',
})}
label={__(toCapitalCase('historical'))}
label={__('Historical')}
/>
<Button
button="alt"
@ -240,13 +236,12 @@ function TxoList(props: Props) {
className={classnames(`button-toggle`, {
'button-toggle--active': active === 'all',
})}
label={__(toCapitalCase('all'))}
label={__('All')}
/>
</div>
</fieldset-section>
</div>
</div>
{/* show active/spent */}
</div>
<TransactionListTable txos={txoPage} />
<Paginate totalPages={Math.ceil(txoItemCount / Number(pageSize))} />

View file

@ -6139,9 +6139,9 @@ lazy-val@^1.0.4:
yargs "^13.2.2"
zstd-codec "^0.1.1"
lbry-redux@lbryio/lbry-redux#cd3fa330663a21e21cb36f29104ab2a408d5412d:
lbry-redux@lbryio/lbry-redux#07dff852f1529c242bb830a26d9603f81ac00954:
version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/cd3fa330663a21e21cb36f29104ab2a408d5412d"
resolved "https://codeload.github.com/lbryio/lbry-redux/tar.gz/07dff852f1529c242bb830a26d9603f81ac00954"
dependencies:
proxy-polyfill "0.1.6"
reselect "^3.0.0"