Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new channel creating and editing #4445

Merged
merged 15 commits into from
Jul 3, 2020
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@datapunt/matomo-tracker-js": "^0.1.4",
"@exponent/electron-cookies": "^2.0.0",
"@hot-loader/react-dom": "^16.8",
"@lbry/components": "^4.2.2",
"@lbry/components": "^4.2.5",
"@reach/menu-button": "0.7.4",
"@reach/rect": "^0.2.1",
"@reach/tabs": "^0.1.5",
Expand Down Expand Up @@ -135,7 +135,7 @@
"imagesloaded": "^4.1.4",
"json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#eb47b7e5b6cc24db93b2b66cf1153b02858caf58",
"lbry-redux": "lbryio/lbry-redux#906199d866a187015668a27363f010828c15979a",
"lbryinc": "lbryio/lbryinc#72eee35f5181940eb4a468a27ddb2a2a4e362fb0",
"lint-staged": "^7.0.2",
"localforage": "^1.7.1",
Expand Down
31 changes: 30 additions & 1 deletion static/app-strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1260,5 +1260,34 @@
"Opt out of any topics you don't want to receive email about.": "Opt out of any topics you don't want to receive email about.",
"Uncheck your email below if you want to stop receiving messages.": "Uncheck your email below if you want to stop receiving messages.",
"Remove from Blocked List": "Remove from Blocked List",
"Are you sure you want to remove this from the list?": "Are you sure you want to remove this from the list?"
"Are you sure you want to remove this from the list?": "Are you sure you want to remove this from the list?",
"Cover": "Cover",
"Url": "Url",
"New Channel Advanced": "New Channel Advanced",
"WTF": "WTF",
"required": "required",
"A name is required for your url": "A name is required for your url",
"Edit Channel": "Edit Channel",
"Create Channel": "Create Channel",
"This shoul de such a size": "This shoul de such a size",
"Thumbnail This shoul de such a size": "Thumbnail This shoul de such a size",
"Cover This shoul de such a size": "Cover This shoul de such a size",
"CableTube Escape Artists": "CableTube Escape Artists",
"General": "General",
"MyAwesomeChannel": "MyAwesomeChannel",
"My Awesome Channel": "My Awesome Channel",
"Increasing your deposit can help your channel be discovered more easily.": "Increasing your deposit can help your channel be discovered more easily.",
"Editing @%channel%": "Editing @%channel%",
"This field cannot be changed.": "This field cannot be changed.",
"Delete Channel": "Delete Channel",
"Edit Thumbnail Image": "Edit Thumbnail Image",
"(Y x Z)": "(Y x Z)",
"Choose Image": "Choose Image",
"File to upload": "File to upload",
"Use a URL instead": "Use a URL instead",
"Edit Cover Image": "Edit Cover Image",
"Cover Image": "Cover Image",
"You Followed Your First Channel!": "You Followed Your First Channel!",
"Awesome! You just followed your first first channel.": "Awesome! You just followed your first first channel.",
"After submitting, it will take a few minutes for your changes to be live for everyone.": "After submitting, it will take a few minutes for your changes to be live for everyone."
}
10 changes: 6 additions & 4 deletions ui/component/channelAbout/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ function ChannelAbout(props: Props) {
<div className="card">
<section className="section card--section">
<Fragment>
<label>{__('Description')}</label>
{description && (
<div className="media__info-text media__info-text--constrained">
<MarkdownPreview content={description} />
</div>
<>
<label>{__('Description')}</label>
<div className="media__info-text media__info-text--constrained">
<MarkdownPreview content={description} />
</div>
</>
)}
{email && (
<Fragment>
Expand Down
2 changes: 1 addition & 1 deletion ui/component/channelCreate/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ChannelCreate extends React.PureComponent<Props, State> {

this.state = {
newChannelName: '',
newChannelBid: 0.01,
newChannelBid: 0.001,
newChannelNameError: '',
newChannelBidError: '',
};
Expand Down
20 changes: 17 additions & 3 deletions ui/component/channelEdit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,49 @@ import {
makeSelectTitleForUri,
makeSelectThumbnailForUri,
makeSelectCoverForUri,
selectCurrentChannelPage,
makeSelectMetadataItemForUri,
doUpdateChannel,
doCreateChannel,
makeSelectAmountForUri,
makeSelectClaimForUri,
selectUpdateChannelError,
selectUpdatingChannel,
selectCreateChannelError,
selectCreatingChannel,
selectBalance,
doClearChannelErrors,
} from 'lbry-redux';
import { doOpenModal } from 'redux/actions/app';

import ChannelPage from './view';

const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
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),
updatingChannel: selectUpdatingChannel(state),
createError: selectCreateChannelError(state),
creatingChannel: selectCreatingChannel(state),
balance: selectBalance(state),
});

const perform = dispatch => ({
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
updateChannel: params => dispatch(doUpdateChannel(params)),
createChannel: params => {
const { name, amount, ...optionalParams } = params;
return dispatch(doCreateChannel('@' + name, amount, optionalParams));
},
clearChannelErrors: () => dispatch(doClearChannelErrors()),
});

export default connect(select, perform)(ChannelPage);