remove tip from channel page

This commit is contained in:
seanyesmunt 2018-05-30 23:50:12 -04:00 committed by Sean Yesmunt
parent f669714553
commit 5ad42609c3
2 changed files with 11 additions and 15 deletions

View file

@ -6,7 +6,6 @@ import {
makeSelectFetchingChannelClaims, makeSelectFetchingChannelClaims,
makeSelectCurrentParam, makeSelectCurrentParam,
selectCurrentParams, selectCurrentParams,
doNotify,
} from 'lbry-redux'; } from 'lbry-redux';
import { doNavigate } from 'redux/actions/navigation'; import { doNavigate } from 'redux/actions/navigation';
import { makeSelectTotalPagesForChannel } from 'redux/selectors/content'; import { makeSelectTotalPagesForChannel } from 'redux/selectors/content';
@ -25,7 +24,6 @@ const perform = dispatch => ({
fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)), fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)),
fetchClaimCount: uri => dispatch(doFetchClaimCountByChannel(uri)), fetchClaimCount: uri => dispatch(doFetchClaimCountByChannel(uri)),
navigate: (path, params) => dispatch(doNavigate(path, params)), navigate: (path, params) => dispatch(doNavigate(path, params)),
openModal: (modal, props) => dispatch(doNotify(modal, props)),
}); });
export default connect(select, perform)(ChannelPage); export default connect(select, perform)(ChannelPage);

View file

@ -1,7 +1,6 @@
// @flow // @flow
import React from 'react'; import React from 'react';
import BusyIndicator from 'component/common/busy-indicator'; import BusyIndicator from 'component/common/busy-indicator';
import Button from 'component/button';
import { FormField, FormRow } from 'component/common/form'; import { FormField, FormRow } from 'component/common/form';
import ReactPaginate from 'react-paginate'; import ReactPaginate from 'react-paginate';
import SubscribeButton from 'component/subscribeButton'; import SubscribeButton from 'component/subscribeButton';
@ -9,7 +8,6 @@ import ViewOnWebButton from 'component/viewOnWebButton';
import Page from 'component/page'; import Page from 'component/page';
import FileList from 'component/fileList'; import FileList from 'component/fileList';
import type { Claim } from 'types/claim'; import type { Claim } from 'types/claim';
import { MODALS } from 'lbry-redux';
type Props = { type Props = {
uri: string, uri: string,
@ -22,7 +20,6 @@ type Props = {
fetchClaims: (string, number) => void, fetchClaims: (string, number) => void,
fetchClaimCount: string => void, fetchClaimCount: string => void,
navigate: (string, {}) => void, navigate: (string, {}) => void,
openModal: (string, {}) => void,
}; };
class ChannelPage extends React.PureComponent<Props> { class ChannelPage extends React.PureComponent<Props> {
@ -51,16 +48,23 @@ class ChannelPage extends React.PureComponent<Props> {
this.props.navigate('/show', newParams); this.props.navigate('/show', newParams);
} }
paginate(e, totalPages) { paginate(e, totalPages: number) {
// Change page if enter was pressed, and the given page is between // Change page if enter was pressed, and the given page is between
// the first and the last. // the first and the last.
if (e.keyCode === 13 && e.target.value > 0 && e.target.value <= totalPages) { const pageFromInput = Number(e.target.value);
this.changePage(e.target.value);
if (
e.keyCode === 13 &&
!Number.isNaN(pageFromInput) &&
pageFromInput > 0 &&
pageFromInput <= totalPages
) {
this.changePage(pageFromInput);
} }
} }
render() { render() {
const { fetching, claimsInChannel, claim, page, totalPages, uri, openModal } = this.props; const { fetching, claimsInChannel, claim, page, totalPages } = this.props;
const { name, permanent_url: permanentUrl, claim_id: claimId } = claim; const { name, permanent_url: permanentUrl, claim_id: claimId } = claim;
let contentList; let contentList;
@ -80,12 +84,6 @@ class ChannelPage extends React.PureComponent<Props> {
<section className="card__channel-info card__channel-info--large"> <section className="card__channel-info card__channel-info--large">
<h1>{name}</h1> <h1>{name}</h1>
<div className="card__actions card__actions--no-margin"> <div className="card__actions card__actions--no-margin">
<Button
button="alt"
iconRight="Send"
label={__('Enjoy this? Send a tip')}
onClick={() => openModal(MODALS.SEND_TIP, { uri })}
/>
<SubscribeButton uri={permanentUrl} channelName={name} /> <SubscribeButton uri={permanentUrl} channelName={name} />
<ViewOnWebButton uri={`${name}:${claimId}`} /> <ViewOnWebButton uri={`${name}:${claimId}`} />
</div> </div>