2019-06-28 19:00:29 +02:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import {
|
|
|
|
makeSelectTitleForUri,
|
|
|
|
makeSelectThumbnailForUri,
|
|
|
|
makeSelectCoverForUri,
|
|
|
|
selectCurrentChannelPage,
|
|
|
|
makeSelectMetadataItemForUri,
|
|
|
|
doUpdateChannel,
|
|
|
|
makeSelectAmountForUri,
|
2019-08-15 13:36:03 +02:00
|
|
|
makeSelectClaimForUri,
|
2020-06-19 18:26:52 +02:00
|
|
|
selectUpdateChannelError,
|
2019-06-28 19:00:29 +02:00
|
|
|
} from 'lbry-redux';
|
|
|
|
import ChannelPage from './view';
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
title: makeSelectTitleForUri(props.uri)(state),
|
2019-09-23 17:02:30 +02:00
|
|
|
thumbnailUrl: makeSelectThumbnailForUri(props.uri)(state),
|
|
|
|
coverUrl: makeSelectCoverForUri(props.uri)(state),
|
2019-06-28 19:00:29 +02:00
|
|
|
page: selectCurrentChannelPage(state),
|
|
|
|
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
|
|
|
|
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),
|
|
|
|
email: makeSelectMetadataItemForUri(props.uri, 'email')(state),
|
|
|
|
tags: makeSelectMetadataItemForUri(props.uri, 'tags')(state),
|
|
|
|
locations: makeSelectMetadataItemForUri(props.uri, 'locations')(state),
|
|
|
|
languages: makeSelectMetadataItemForUri(props.uri, 'languages')(state),
|
|
|
|
amount: makeSelectAmountForUri(props.uri)(state),
|
2019-08-15 13:36:03 +02:00
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2020-06-19 18:26:52 +02:00
|
|
|
updateError: selectUpdateChannelError(state),
|
2019-06-28 19:00:29 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
updateChannel: params => dispatch(doUpdateChannel(params)),
|
|
|
|
});
|
|
|
|
|
2020-03-13 23:15:37 +01:00
|
|
|
export default connect(select, perform)(ChannelPage);
|