Skip to content

Commit

Permalink
fix: a safer way of overwriting the prop (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jefferson Rabb authored Aug 25, 2020
1 parent b44214c commit c86e555
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/editor/taxonomy-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,18 @@ export const TaxonomyPanel = PostTaxonomies => {
labels.name.toLowerCase()
);

// Remove "Add new sponsors" link since sponsor terms are shadow terms of sponsor posts.
if ( 'newspack_spnsrs_tax' === slug ) {
props.hasCreateAction = false;
}

return (
<Fragment>
{ 'newspack_spnsrs_cpt' === postType && ( slug === 'category' || slug === 'post_tag' ) && (
<p>
<em>{ message }</em>
</p>
) }
<PostTaxonomies { ...props } />
<PostTaxonomies
{ ...props }
// Remove "Add new sponsors" link since sponsor terms are shadow terms of sponsor posts.
hasCreateAction={ 'newspack_spnsrs_tax' !== slug }
/>
</Fragment>
);
};
Expand Down

0 comments on commit c86e555

Please sign in to comment.