-
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: Filter main feed based on sidebar selection (#97123)
* Extends the `Recent` menu item on sidebar with the list of subscribed posts which have also made it consistent with the new designs. * Update the `/following` API calls to include the selected `feed_id`.
- Loading branch information
Showing
11 changed files
with
185 additions
and
100 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
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 was deleted.
Oops, something went wrong.
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,41 @@ | ||
import 'calypso/state/reader-ui/init'; | ||
import { AppState } from 'calypso/types'; | ||
|
||
/** | ||
* Whether or not a specific reader organization sidebar item is open. | ||
*/ | ||
export function isOrganizationOpen( state: AppState, organizationId: number ): boolean { | ||
const openOrganizations = state.readerUi.sidebar.openOrganizations; | ||
if ( openOrganizations.indexOf( organizationId ) > -1 ) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
/** | ||
* Whether or not following reader sidebar item is open. | ||
*/ | ||
export function isFollowingOpen( state: AppState ): boolean { | ||
return state.readerUi.sidebar.isFollowingOpen; | ||
} | ||
|
||
/** | ||
* Whether or not lists reader sidebar item is open. | ||
*/ | ||
export function isListsOpen( state: AppState ): boolean { | ||
return state.readerUi.sidebar.isListsOpen; | ||
} | ||
|
||
/** | ||
* Whether or not tags reader sidebar item is open. | ||
*/ | ||
export function isTagsOpen( state: AppState ): boolean { | ||
return state.readerUi.sidebar.isTagsOpen; | ||
} | ||
|
||
/** | ||
* Get the selected feed ID from the reader sidebar. | ||
*/ | ||
export function getSelectedFeedId( state: AppState ): number | null { | ||
return state.readerUi.sidebar.selectedRecentSite; | ||
} |
Oops, something went wrong.