make channel names on discover page links #869
No reviewers
Labels
No labels
accessibility
app-parity
area: creator
area: daemon
area: design
area: devops
area: discovery
area: docs
area: installer
area: internal
area: livestream
area: performance
area: proposal
area: reposts
area: rewards
area: search
area: security
area: subscriptions
area: sync
area: ux
area: viewer
area: wallet
BEAMER
channel
comments
community PR
consider soon
core team
css
dependencies
electron
Epic
feature request
first-timers-only
good first issue
hacktoberfest
help wanted
hub-dependent
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
merge when green
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
notifications
odysee
on hold
playlists
priority: blocker
priority: high
priority: low
priority: medium
protocol dependent
recsys
redesign
regression
resilience
sdk dependent
Tom's Wishlist
trending
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry-desktop#869
Loading…
Reference in a new issue
No description provided.
Delete branch "master"
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?
Thanks @daovist! @seanyesmunt can you review this to make sure it is up to your UI standards? also, the
@stealthishow
is now green because it is a link, do you think we should keep it that way or change it back to gray?Thanks for the contribution @daovist!
@liamcardenas I think the green color is good, it looks the same as on the file page.
Small issue
Instead of closing the link here, does it work if you keep it at the bottom and encapsulate the new link? You should still be able to click on the file if your mouse is below the channel name.
Hope that makes sense
That was my first thought too. In that case it takes you to the file page and not the channel page. Though I think it actually takes you to the channel page and then the file page (calling the navigate function twice?) because when I click the channel link and then click Back it does take me to the channel page.
I ended up wrapping links around the image, title, and price to avoid this.
@daovist - also be sure to check out https://lbry.io/faq/tips
Thanks again for your contribution!
You should be able to use
e.stopPropagation
to fix that. We still want to keep just one link for the whole card. You could update the<Link />
component to take a propnoPropagation
which would calle.stopPropagation()
before doing the navigate.I think that would work.
Actually I am seeing that nested links are illegal in HTML5. I just tested and my idea works, but I see an ugly error.
@kauffj thoughts?
I think the larger issue is that internal links should just be buttons (which I am going to do for the redesign).
@seanyesmunt Not sure of another solution to the nested anchor issue other than just attaching an
onClick
to a non-anchor element like a<div>
. I believe we ran into this on<FileTile>
and that's what it does.I think that would be fine for now. @daovist could you try replacing the wrapper
<Link />
to a div and moving theonClick
to that? Then you would be able to add the link to the channel no problem. (you would still need to add thee.stopPropagation
I'm trying. The URI it gives me is for the video and I haven't figured out how to get the channel link the way the UriIndicator component does. I'm messing around with lbryuri.js but not having any luck so far.
You should still use the
UriIndicator
component. Just change the highest level wrapper<Link
to adiv
.If you still the the
navigate
action being fired twice you can change the<Link
component to useevent.stopPropagation()
Maybe something like this
You can message me on discord if that doesn't work, a little easier to chat there.
Nested anchors work but are not legit HTML. When I replace anchor with a span or div it messes up a lot of things throughout LBRY, such as FAQ and TOS links, not to mention navigation. So I added a span value to props which if true returns a span instead of an anchor which I am using to link to the channel pages of videos on the Discover page.
this can just be
if(span) {
this whole thing should probably be structured like this
let props = { className: combinedClassName, href: href || "javascript:;" etc}
and then the if statement should be something like
return span ? <span {...props}> {content} </span> : <a {...props}> {content} </a>
as per https://zhenyong.github.io/react/docs/jsx-spread.html
let me know if you have any questions!
whenever you are ready to merge, be sure to remove this ;)
One issue then I will merge it
You can just pass this in as is
span={span}
If it is
undefined
that is okCould you also squash these commits into one commit?