mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
Remove useless settings dispatcher component
Signed-off-by: soupette <cyril.lpz@gmail.com>
This commit is contained in:
parent
13e5795fdd
commit
8cfe4bd2cc
@ -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);
|
||||
@ -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';
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user