lbry-desktop/ui/component/channelEdit/index.js
2020-06-19 12:41:45 -04:00

35 lines
1.3 KiB
JavaScript

import { connect } from 'react-redux';
import {
makeSelectTitleForUri,
makeSelectThumbnailForUri,
makeSelectCoverForUri,
selectCurrentChannelPage,
makeSelectMetadataItemForUri,
doUpdateChannel,
makeSelectAmountForUri,
makeSelectClaimForUri,
selectUpdateChannelError,
} from 'lbry-redux';
import ChannelPage from './view';
const select = (state, props) => ({
title: makeSelectTitleForUri(props.uri)(state),
thumbnailUrl: makeSelectThumbnailForUri(props.uri)(state),
coverUrl: makeSelectCoverForUri(props.uri)(state),
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),
claim: makeSelectClaimForUri(props.uri)(state),
updateError: selectUpdateChannelError(state),
});
const perform = dispatch => ({
updateChannel: params => dispatch(doUpdateChannel(params)),
});
export default connect(select, perform)(ChannelPage);