React/Redux - publish component #323
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
Osprey
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
resilience
Tom's Wishlist
type: bug
type: discussion
type: error handling
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/spee.ch#323
Loading…
Reference in a new issue
No description provided.
Delete branch "react-upload"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Some not especially thorough feedback
What is the
|
doing here?I think just
ChannelSelect
is a fine name for this. "None" is just a choice.These consts need to be shared across files
I suspect this shouldn't be necessary with addition of Redux
I suspect there is a less hacky way to do this ;)
You should look at some of the linting additions @IGassman has added to app, could help keep these imports consistent in path specification (among other improvements).
import * as
Some of these should possibly be renamed or refactored into separate files (or possibly can wait until next refactor/revision).
GIFs
Shouldn't this design be obviated by addition of React/Redux? The component should be able to refresh based on external state change
This doesn't seem exactly on theme. Maybe ask nizuka?
It looks as if its seeding the progress visually, is that correct?
I'm interested in the direction of this PR, it seems to be purposed as an image sharing service as per required. .png .jpeg .gif ... requirements. Can we still publish video and is there support for generic file types? It just feels like its moving away from video upload and I wanted to be clear.
Generally you should avoid doing dom stuff/setting state in
componentWillMount
. Especially since it seems that they will be removing it in a future React version.componentDidMount
is preferredInstead of adding react elements to state, just store the data.
Then in the
render
function, you can dothis.state.bars.map((bar, index) => bar.isActive ? <ActiveBar key={index} /> : <InactiveBar key={index} />)
Forms are one of the most painful things in React. It might be worth looking into 3rd party React form elements. I've done a fair bit of work with forms and think that Formik is really nice. Hoping to add it to more parts of the app soon. https://github.com/jaredpalmer/formik
I really like how they use the
render
prop, I think it's a really nice way to interact with React elementsSame here, this should be moved to
componentDidMount
Instead of reading prop values and adding them to state, you should just use the prop values and not worry about internal state.
I try to avoid internal state whenever possible, one exception is the app homepage, where we store if the user can scroll left or right in a card row. But that isn't dependent on any prop value, just by what is currently on the screen.
Whenever you separate the data into two sources it can cause some weird issues.
Left a few comments. Looking good!
@etisdew yes
video/mp4
is supported and supporting video uploads is a key goal for spee.chThe reason for this was that html outside of the react publish component (the top nav bar) needed to be updated. To solve this, I added a nav bar component that can draw from the store.
Yes, I am rendering the
|
s for the progress bars@seanyesmunt The issue I am struggling with, is that I (think) I need the
<select>
element to be a controlled component, and if so then it seems like it would be best to use internal state rather than the store, since no other component should care what option is selected unless this component decides to update the state of the store. The reason I am setting the state when the component mounts and when it receives props, is that if another component updates the store when a new channel is logged into, then I want this<select>
element to re-render with that option selected. Any ideas on how I can approach this differently so that I can eliminate internal state while still accomplishing those goals?About 1/2 of a review
This probably should not be a string based check.
We should look at getting all of this out of the cookie entirely.
Misnamed
All get and post requests should not assume a 401 means invalid username and password. Instead, have the server pass back the error message. Also, checks for 401 vs. 403 appear to be inconsistent.