-
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
Changes from all commits
40fda79
1cb1eb6
71b43d4
61df393
5bfc556
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,17 @@ function getPostUrl( post ) { | |
return '/read/blogs/' + post.site_ID + '/posts/' + post.ID; | ||
} | ||
|
||
const FEED_FEATURED_MAX_POST_COUNT = 3; | ||
|
||
/* eslint-disable wpcalypso/jsx-classname-namespace */ | ||
// This component is used in the Discover site stream only. | ||
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 ) { | ||
this.props.requestPage( { streamKey: this.props.streamKey } ); | ||
} | ||
} | ||
|
||
handleClick = postData => { | ||
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. That's actually a better idea than my I'll ship this for now and bear it in mind for future improvements 👍 |
||
key={ post.ID } | ||
className="reader__featured-post" | ||
onClick={ this.handleClick.bind( this, postData ) } | ||
> | ||
<div className="reader__featured-post-image" style={ style } /> | ||
<h2 className="reader__featured-post-title">{ post.title }</h2> | ||
</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.
Previously, it was possible for the same set of posts to appear twice if the component re-mounted.