-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reader: clean up cardpicking logic / move off sitestore/feedstore (#1…
…1618) * Simplify CardPicking logic to only exist within PostLifecycle before this PR, the logic of which card to choose was split between post lifcycle, stream, and search stream. they also often had their own adapters. This is one step towards simplifying it by moving all of the selection to postlifecycle. there is still more work to do here * split out empty search rec to its own file * small style change * revert changes to util * removed unecessarily changed line * omit isRecommendation from postKey before searching * refs made by keyToString, fix onClick handler for CC * unmodify prop * put a gap higher up * fixed gaps * rejigger blocks to work with new blockedSites prop * Addressed PR feedback * also remove changes to wpcom.Undocumented * transform items first
- Loading branch information
Showing
6 changed files
with
146 additions
and
239 deletions.
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.