Remove useless settings dispatcher component

Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
soupette 2021-06-10 12:16:15 +02:00
parent 13e5795fdd
commit 8cfe4bd2cc
3 changed files with 1 additions and 37 deletions

View File

@ -1,28 +0,0 @@
import React, { memo } from 'react';
import { useStrapiApp } from '@strapi/helper-plugin';
import { get } from 'lodash';
import { useParams } from 'react-router-dom';
import PageTitle from '../../../../components/SettingsPageTitle';
const SettingDispatcher = () => {
const { plugins } = useStrapiApp();
const { pluginId } = useParams();
const pluginToRender = get(plugins, [pluginId, 'settings', 'mainComponent'], null);
if (!pluginToRender) {
return null;
}
const Compo = pluginToRender;
return (
<>
<PageTitle name={pluginId} />
{/* FIXME */}
<Compo />
</>
);
};
export default memo(SettingDispatcher);

View File

@ -1,5 +1,4 @@
export { default as ApplicationDetailLink } from './ApplicationDetailLink';
export { default as MenuWrapper } from './MenuWrapper';
export { default as SettingDispatcher } from './SettingDispatcher';
export { default as StyledLeftMenu } from './StyledLeftMenu';
export { default as Wrapper } from './Wrapper';

View File

@ -24,13 +24,7 @@ import SettingsSearchHeaderProvider from '../../components/SettingsHeaderSearchC
import { useSettingsMenu } from '../../hooks';
import ApplicationInfosPage from '../ApplicationInfosPage';
import {
ApplicationDetailLink,
MenuWrapper,
SettingDispatcher,
StyledLeftMenu,
Wrapper,
} from './components';
import { ApplicationDetailLink, MenuWrapper, StyledLeftMenu, Wrapper } from './components';
import {
createRoute,
@ -124,7 +118,6 @@ function SettingsPage() {
<Route path="/settings/application-infos" component={ApplicationInfosPage} exact />
{adminRoutes}
{pluginsRoutes}
<Route path="/settings/:pluginId" component={SettingDispatcher} />
</Switch>
</div>
</div>