2023-09-14 10:48:07 +03:00
|
|
|
import MainContent from './MainContent';
|
2024-07-29 12:57:53 +03:00
|
|
|
import NiceModal from '@ebay/nice-modal-react';
|
2023-11-14 16:50:08 +03:00
|
|
|
import SettingsAppProvider, {OfficialTheme, UpgradeStatusType} from './components/providers/SettingsAppProvider';
|
|
|
|
import SettingsRouter, {loadModals, modalPaths} from './components/providers/SettingsRouter';
|
2023-11-20 16:30:15 +03:00
|
|
|
import {DesignSystemApp, DesignSystemAppProps} from '@tryghost/admin-x-design-system';
|
|
|
|
import {FrameworkProvider, TopLevelFrameworkProps} from '@tryghost/admin-x-framework';
|
2023-11-22 10:51:10 +03:00
|
|
|
import {RoutingProvider} from '@tryghost/admin-x-framework/routing';
|
2023-08-16 20:59:31 +03:00
|
|
|
import {ZapierTemplate} from './components/settings/advanced/integrations/ZapierModal';
|
2023-05-16 09:23:36 +03:00
|
|
|
|
2023-11-20 16:30:15 +03:00
|
|
|
interface AppProps {
|
|
|
|
framework: TopLevelFrameworkProps;
|
|
|
|
designSystem: DesignSystemAppProps;
|
2023-07-13 04:12:31 +03:00
|
|
|
officialThemes: OfficialTheme[];
|
2023-08-16 20:59:31 +03:00
|
|
|
zapierTemplates: ZapierTemplate[];
|
2023-10-11 12:09:56 +03:00
|
|
|
upgradeStatus?: UpgradeStatusType;
|
2023-06-01 10:53:45 +03:00
|
|
|
}
|
|
|
|
|
2023-11-20 16:30:15 +03:00
|
|
|
function App({framework, designSystem, officialThemes, zapierTemplates, upgradeStatus}: AppProps) {
|
2023-05-16 09:23:36 +03:00
|
|
|
return (
|
2023-11-22 10:51:10 +03:00
|
|
|
<FrameworkProvider {...framework}>
|
2023-11-14 16:50:08 +03:00
|
|
|
<SettingsAppProvider officialThemes={officialThemes} upgradeStatus={upgradeStatus} zapierTemplates={zapierTemplates}>
|
2024-07-29 12:57:53 +03:00
|
|
|
{/* NOTE: we need to have an extra NiceModal.Provider here because the one inside DesignSystemApp
|
|
|
|
is loaded too late for possible modals in RoutingProvider, and it's quite hard to change it at
|
|
|
|
this point */}
|
|
|
|
<NiceModal.Provider>
|
|
|
|
<RoutingProvider basePath='settings' modals={{paths: modalPaths, load: loadModals}}>
|
|
|
|
<DesignSystemApp className='admin-x-settings' {...designSystem}>
|
|
|
|
<SettingsRouter />
|
|
|
|
<MainContent />
|
|
|
|
</DesignSystemApp>
|
|
|
|
</RoutingProvider>
|
|
|
|
</NiceModal.Provider>
|
2023-11-14 16:50:08 +03:00
|
|
|
</SettingsAppProvider>
|
|
|
|
</FrameworkProvider>
|
2023-05-16 09:23:36 +03:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|