Skip to content

Commit

Permalink
Merge pull request #2088 from jessopb/channelShare
Browse files Browse the repository at this point in the history
adds shareModal to channel page
  • Loading branch information
Sean Yesmunt authored Nov 5, 2018
2 parents 0b640ff + 350bf32 commit f621440
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* Persistence to Transaction List Filter Selection ([#2048](https://github.com/lbryio/lbry-desktop/pull/2048))
* Subscription improvements ([#2031](https://github.com/lbryio/lbry-desktop/pull/2031))
* Adds Persistence to File List Filter Selections ([#2050](https://github.com/lbryio/lbry-desktop/pull/2050))
* Add more share options for channel page ([#2088](https://github.com/lbryio/lbry-desktop/pull/2088))

### Changed
* Upgraded to lbrynet v0.30.0 ([#1998](https://github.com/lbryio/lbry-desktop/pull/1998))
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/page/channel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
makeSelectClaimIsMine,
makeSelectTotalPagesForChannel,
selectCurrentParams,
doNotify,
} from 'lbry-redux';
import { doNavigate } from 'redux/actions/navigation';
import ChannelPage from './view';
Expand All @@ -27,6 +28,7 @@ const perform = dispatch => ({
fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)),
fetchClaimCount: uri => dispatch(doFetchClaimCountByChannel(uri)),
navigate: (path, params) => dispatch(doNavigate(path, params)),
openModal: (modal, props) => dispatch(doNotify(modal, props)),
});

export default connect(
Expand Down
26 changes: 21 additions & 5 deletions src/renderer/page/channel/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import BusyIndicator from 'component/common/busy-indicator';
import { FormField, FormRow } from 'component/common/form';
import ReactPaginate from 'react-paginate';
import SubscribeButton from 'component/subscribeButton';
import ViewOnWebButton from 'component/viewOnWebButton';
import Page from 'component/page';
import FileList from 'component/fileList';
import HiddenNsfwClaims from 'component/hiddenNsfwClaims';
import type { Claim } from 'types/claim';
import Button from 'component/button';
import { MODALS } from 'lbry-redux';
import * as icons from 'constants/icons';

type Props = {
uri: string,
Expand All @@ -22,6 +24,7 @@ type Props = {
fetchClaims: (string, number) => void,
fetchClaimCount: string => void,
navigate: (string, {}) => void,
openModal: ({ id: string }, { uri: string }) => void,
};

class ChannelPage extends React.PureComponent<Props> {
Expand Down Expand Up @@ -67,10 +70,18 @@ class ChannelPage extends React.PureComponent<Props> {
}

render() {
const { uri, fetching, claimsInChannel, claim, page, totalPages, channelIsMine } = this.props;
const { name, permanent_url: permanentUrl, claim_id: claimId } = claim;
const {
uri,
fetching,
claimsInChannel,
claim,
page,
totalPages,
channelIsMine,
openModal,
} = this.props;
const { name, permanent_url: permanentUrl } = claim;
const currentPage = parseInt((page || 1) - 1, 10);

const contentList =
claimsInChannel && claimsInChannel.length ? (
<FileList sortByHeight hideFilter fileInfos={claimsInChannel} />
Expand All @@ -88,7 +99,12 @@ class ChannelPage extends React.PureComponent<Props> {
</section>
<div className="card__actions">
<SubscribeButton uri={`lbry://${permanentUrl}`} channelName={name} />
<ViewOnWebButton claimId={claimId} claimName={name} />
<Button
button="alt"
icon={icons.GLOBE}
label={__('Share Channel')}
onClick={() => openModal({ id: MODALS.SOCIAL_SHARE }, { uri, speechShareable: true })}
/>
</div>
<section className="card__content">{contentList}</section>
{(!fetching || (claimsInChannel && claimsInChannel.length)) &&
Expand Down

0 comments on commit f621440

Please sign in to comment.