Skip to content

Commit

Permalink
fix(homepage-posts): display info about load more posts if blog is pr…
Browse files Browse the repository at this point in the history
  • Loading branch information
adekbadek committed Sep 8, 2020
1 parent b715706 commit 11e2934
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/blocks/homepage-articles/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,16 +328,23 @@ class Edit extends Component {
required
/>
) }
{ ! specificMode && ! isBlogPrivate() && (
{ ! specificMode && isBlogPrivate() ? (
/*
* Hide the "More" button option on private sites.
* Hide the "Load more posts" button option on private sites.
*
* Client-side fetching from a private WP.com blog requires authentication,
* which is not provided in the current implementation.
* See https://github.com/Automattic/newspack-blocks/issues/306.
*/
<i>
{ __(
'This blog is private, therefore the "Load more posts" feature is not active.',
'newspack-blocks'
) }
</i>
) : (
<ToggleControl
label={ __( 'Show "More" Button', 'newspack-blocks' ) }
label={ __( 'Show "Load more posts" Button', 'newspack-blocks' ) }
checked={ moreButton }
onChange={ () => setAttributes( { moreButton: ! moreButton } ) }
/>
Expand Down

0 comments on commit 11e2934

Please sign in to comment.