-
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: clean up cardpicking logic / move off sitestore/feedstore #11618
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ddb96e1
Simplify CardPicking logic to only exist within PostLifecycle
samouri 4e287b0
split out empty search rec to its own file
samouri 3729383
small style change
samouri b719edf
revert changes to util
samouri ba0f420
removed unecessarily changed line
samouri cf68352
omit isRecommendation from postKey before searching
samouri 4df1afe
refs made by keyToString, fix onClick handler for CC
samouri 6627303
unmodify prop
samouri fc3adc4
put a gap higher up
samouri b2b206a
fixed gaps
samouri 57900b7
rejigger blocks to work with new blockedSites prop
samouri 4498686
Addressed PR feedback
samouri 4cdef90
also remove changes to wpcom.Undocumented
samouri d4a897c
transform items first
samouri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React from 'react'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { RelatedPostCard } from 'blocks/reader-related-card-v2'; | ||
import { recordTrackForPost, recordAction } from 'reader/stats'; | ||
import { EMPTY_SEARCH_RECOMMENDATIONS, } from 'reader/follow-button/follow-sources'; | ||
|
||
export default function EmptySearchRecommendedPost( { post } ) { | ||
function handlePostClick() { | ||
recordTrackForPost( 'calypso_reader_recommended_post_clicked', post, { | ||
recommendation_source: 'empty-search', | ||
} ); | ||
recordAction( 'search_page_rec_post_click' ); | ||
} | ||
|
||
function handleSiteClick() { | ||
recordTrackForPost( 'calypso_reader_recommended_site_clicked', post, { | ||
recommendation_source: 'empty-search', | ||
} ); | ||
recordAction( 'search_page_rec_site_click' ); | ||
} | ||
|
||
const site = { title: post.site_name, }; | ||
|
||
return ( | ||
<div className="search-stream__recommendation-list-item" key={ post.global_ID }> | ||
<RelatedPostCard post={ post } site={ site } | ||
onSiteClick={ handleSiteClick } onPostClick={ handlePostClick } followSource={ EMPTY_SEARCH_RECOMMENDATIONS } /> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
stray comma
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.
AFAIK dangling commas are ok?
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, just looks funny with a one item list :)