-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Reader: Discover featured posts accessibility improvements #27089
Conversation
a86bfae
to
a14ca2e
Compare
class FeedFeatured extends React.PureComponent { | ||
static displayName = 'FeedFeatured'; | ||
|
||
componentDidMount() { | ||
this.props.requestPage( { streamKey: this.props.streamKey } ); | ||
if ( ! this.props.posts || this.props.posts.length < FEED_FEATURED_MAX_POST_COUNT ) { |
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.
Previously, it was possible for the same set of posts to appear twice if the component re-mounted.
client/reader/site-stream/style.scss
Outdated
position: relative; | ||
padding: 0 24px 0 24px; |
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.
Small nitpick: I would just do 0 24px
here.
a14ca2e
to
5bfc556
Compare
I think this is good to go @bluefuton ? |
@@ -63,14 +68,14 @@ class FeedFeatured extends React.PureComponent { | |||
}; | |||
|
|||
return ( | |||
<div | |||
<button |
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.
maybe make this a big anchor instead of a button? It has a URL after all.
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.
That's actually a better idea than my button
, but also scuppers all the styles, especially in the small viewport version 🤦♂️
I'll ship this for now and bear it in mind for future improvements 👍
The featured posts block, as used in Discover, doesn't currently pass our a11y lint check.
This PR aims to fix that by using a
button
element and re-styling accordingly.To test
Visit http://calypso.localhost:3000/discover.
You can also run the linter and check that there are no a11y warnings:
npx eslint client/reader/site-stream/* --ext js,jsx
Ensure that the appearance of the featured block is the same, both above and below 960px width:
http://calypso.localhost:3000/discover
vs
https://wpcalypso.wordpress.com/discover
Todo