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

Channel edit4 #2584

Merged
merged 2 commits into from Jul 2, 2019
Merged

Channel edit4 #2584

merged 2 commits into from Jul 2, 2019

Conversation

jessopb
Copy link
Member

@jessopb jessopb commented Jun 28, 2019

Feature:
Channel page updates
Re: #561

Should be broken out of the channel page - probably requires useContext wrapper.
Not happy with upload function living in component.
Still a bug with updating and status messaging on submit.
Mostly unstyled.

Copy link

@neb-b neb-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is close, we should pull out the channel edit functionality into it's own component, and re-use any publish form logic that we can.

src/ui/component/selectAsset/view.jsx Outdated Show resolved Hide resolved
src/ui/page/channel/view.jsx Show resolved Hide resolved
src/ui/page/channel/view.jsx Outdated Show resolved Hide resolved
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (let i = 0; i < 24; i += 1) text += possible.charAt(Math.floor(Math.random() * 62));
return text;
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already use the uuid module, lets just use that here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flow doesn't like import {v4 as uuidv4} from uuid;

} else if (bid <= MINIMUM_PUBLISH_BID) {
setBidError(__('Your deposit must be higher'));
}
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use this same logic in the publish form. Lets pull it into it's own function.

It can accept bid, balance, amount and return an error if it's bad. If there is no error, update the form, if there is an error, setError

const error = checkBidStuff(amount, balance, bid)
if (error) { 
  setBidError(error)
} else {
  setParams()
} 

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DIdn't do this yet.
I'm thinking checkBidStuff(amount, balance, bid, errorFn, updateFn) would be the signature? Or do I misunderstand you?

updates work

asset upload works

channelForm component
@jessopb
Copy link
Member Author

jessopb commented Jul 2, 2019

This has been updated.

@jessopb jessopb requested a review from neb-b July 2, 2019 13:29
@lbry-bot lbry-bot assigned neb-b and unassigned jessopb Jul 2, 2019
@neb-b neb-b merged commit 1edb35d into master Jul 2, 2019
@lyoshenka lyoshenka deleted the channelEdit4 branch August 5, 2019 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants