Skip to content
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

Hides the discover more section for non-admin users #41474

Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
data: { ownedProducts, unownedProducts },
} = useProductsByOwnership();

const { canUserViewStats } = getMyJetpackWindowInitialState();

const { canUserViewStats, userIsAdmin } = getMyJetpackWindowInitialState();

Check failure on line 113 in projects/packages/my-jetpack/_inc/components/product-cards-section/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint (non-excluded files only)

Delete `··`
const unownedSectionTitle = useMemo( () => {
return ownedProducts.length > 0
? __( 'Discover more', 'jetpack-my-jetpack' )
Expand Down Expand Up @@ -147,7 +147,7 @@
</AdminSectionHero>
) }

{ filteredUnownedProducts.length > 0 && (
{ userIsAdmin && filteredUnownedProducts.length > 0 && (
<Container horizontalSpacing={ 6 } horizontalGap={ noticeMessage ? 3 : 6 }>
<Col>
<Col sm={ 4 } md={ 8 } lg={ 12 } className={ styles.cardListTitle }>
Expand Down
Loading