Skip to content

Commit

Permalink
Remove unneded changes
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiucelfilip committed Oct 22, 2024
1 parent 62da370 commit f0be948
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 24 deletions.
24 changes: 6 additions & 18 deletions client/my-sites/plugins/plugins-browser/single-list-view/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,15 @@ function isNotInstalled( plugin, installedPlugins ) {
);
}

const SingleListView = ( {
category,
plugins,
isFetching,
siteSlug,
sites,
noHeader,
title,
subtitle,
} ) => {
const SingleListView = ( { category, plugins, isFetching, siteSlug, sites, noHeader } ) => {
const translate = useTranslate();

const siteId = useSelector( getSelectedSiteId );
const domain = useSelector( ( state ) => getSiteDomain( state, siteId ) );

const categories = useCategories();
const categoryName = title || categories[ category ]?.title || translate( 'Plugins' );
const categoryDescription = subtitle || categories[ category ]?.description || null;
const categoryName = categories[ category ]?.title || translate( 'Plugins' );
const categoryDescription = categories[ category ]?.description || null;

const { localizePath } = useLocalizedPlugins();

Expand All @@ -60,12 +51,9 @@ const SingleListView = ( {
.filter( isNotBlocked )
.filter( ( plugin ) => ! siteId || isNotInstalled( plugin, installedPlugins ) );

let listLink;
if ( category ) {
listLink = '/plugins/browse/' + category;
if ( domain ) {
listLink += '/' + domain;
}
let listLink = '/plugins/browse/' + category;
if ( domain ) {
listLink = '/plugins/browse/' + category + '/' + domain;
}

if ( ! isFetching && plugins.length === 0 ) {
Expand Down
6 changes: 0 additions & 6 deletions client/my-sites/plugins/plugins-discovery-page/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { TrialAcknowledgeModal } from 'calypso/my-sites/plans/trials/trial-ackno
import { WithOnclickTrialRequest } from 'calypso/my-sites/plans/trials/trial-acknowledge/with-onclick-trial-request';
import { isCompatiblePlugin } from 'calypso/my-sites/plugins/plugin-compatibility';
import { isUserLoggedIn } from 'calypso/state/current-user/selectors';
import { useCategories } from '../categories/use-categories';
import { WPBEGINNER_PLUGINS } from '../constants';
import EducationFooter from '../education-footer';
import CollectionListView from '../plugins-browser/collection-list-view';
Expand Down Expand Up @@ -53,10 +52,7 @@ export const PaidPluginsSection = ( props ) => {
};
export const FeaturedWPBeginnerSection = ( props ) => {
const category = 'wpbeginner';
const categories = useCategories();

const categoryName = categories[ category ]?.title || category;
const categoryDescription = categories[ category ]?.description;
const { data: plugins = [], isFetching } = useESPlugin( WPBEGINNER_PLUGINS );

return (
Expand All @@ -65,8 +61,6 @@ export const FeaturedWPBeginnerSection = ( props ) => {
category={ category }
plugins={ plugins }
isFetching={ isFetching }
title={ categoryName }
subtitle={ categoryDescription }
/>
);
};
Expand Down

0 comments on commit f0be948

Please sign in to comment.