-
Notifications
You must be signed in to change notification settings - Fork 922
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
Desktop News customize: unfollow removes follow #15499
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I've left a few comments, and one question about how the hover/focus works for the cards (for me, when I click on them it focuses the button and moving the mouse off the card means the button stays visible until I click something else).
Approved because it's fairly minor, and definitely an improvement.
interface Props { | ||
channelId: string | ||
channelName: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, in my original iteration I thought channels might have a bit more info - nice to keep things simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we still need to do translation and images and I thought I was going to do that in this PR, but this still makes sense I suppose for now.
@@ -15,7 +15,6 @@ interface Props { | |||
|
|||
const Container = styled(Flex)` | |||
padding: 16px 0; | |||
cursor: pointer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I should've removed this when I got rid of the channel pages
@@ -20,30 +26,27 @@ const Container = styled(Flex) <{ backgroundColor: string }>` | |||
color: white; | |||
position: relative; | |||
|
|||
:hover { | |||
opacity: 0.8; | |||
&[data-channel-card-is-followed=true] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, so I found this a bit weird. When I click on the button, it sets the :focus-within
pseudo element so the button stays visible, even when I move the mouse outside. Then, when I click on something else, the button disappears.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ohh right
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed with :has(:focus-visible)
|
||
&[data-feed-card-is-followed=true] { | ||
&:not(:hover, :focus-within) ${StyledFollowButton} { | ||
opacity: 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, it just feels a bit odd. Maybe this is what we want though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
const Name = styled.span` | ||
font-size: 14px; | ||
font-weight: 600; | ||
` | ||
|
||
const Pulse = keyframes` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -132,7 +81,7 @@ export function DirectFeedCard (props: { | |||
}) { | |||
const [loading, setLoading] = useState(false) | |||
return <Flex direction="column" gap={8}> | |||
<Card backgroundColor={getCardColor(props.feedUrl)}> | |||
<Card backgroundColor={getCardColor(props.feedUrl)} data-feed-card-is-followed={true}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to do this here? I think if the direct feed is followed we will hide it and just show a channel card instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only because it's using the same styles, hence the true
instead of a variable
: <> | ||
{HeartOutline} {getLocale('braveNewsFollowButtonNotFollowing')} | ||
</>} | ||
<Button {...rest} scale='tiny' isPrimary={!following}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice to see the button getting less loud
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can replace this with Leo's button when we have that available and maybe use that opportunity to clean all this up a bit and reduce repetition
<Flex align='center' gap={8}> | ||
<FavIcon src={publisher.faviconUrl?.url} /> | ||
<Text>{publisher.publisherName}</Text> | ||
</Flex> | ||
<ToggleButton> | ||
{subscribed ? Heart : HeartOutline} | ||
<ToggleButton onClick={() => setFollowed(!followed)}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can tidy this up when we add channel images, Leo's button and fallback images
{subscribed ? Heart : HeartOutline} | ||
<ToggleButton onClick={() => setFollowed(!followed)}> | ||
{followed | ||
? getLocale('braveNewsFollowButtonFollowing') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this button is ever in a state where the source is not being followed? Non-followed sources are not shown in the list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I removed the other state
{subscribed ? Heart : HeartOutline} | ||
<ToggleButton onClick={() => setSubscribed(!subscribed)}> | ||
{subscribed | ||
? getLocale('braveNewsFollowButtonFollowing') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…ontent. follow / unfollow button text instead of heart icon
a1f246e
to
e13905d
Compare
A Storybook has been deployed to preview UI for the latest push |
…and does not block ontent. follow / unfollow button text instead of heart icon
There will be a further follow-up to bring the exact design for the Follow / Unfollow button as well as channel icons. This can happen once Leo is available as a dependency.
Resolves brave/brave-browser#26090
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
On issue