2023-07-13 10:12:31 +09:00
|
|
|
import ExitSettingsButton from './components/ExitSettingsButton';
|
2023-08-03 09:29:14 +01:00
|
|
|
import GlobalDataProvider from './components/providers/GlobalDataProvider';
|
2023-05-17 19:09:09 +02:00
|
|
|
import Heading from './admin-x-ds/global/Heading';
|
2023-05-24 16:31:02 +02:00
|
|
|
import NiceModal from '@ebay/nice-modal-react';
|
2023-07-04 20:26:46 +05:30
|
|
|
import RoutingProvider from './components/providers/RoutingProvider';
|
2023-05-16 11:53:36 +05:30
|
|
|
import Settings from './components/Settings';
|
|
|
|
import Sidebar from './components/Sidebar';
|
2023-08-02 08:37:51 +01:00
|
|
|
import {GlobalDirtyStateProvider} from './hooks/useGlobalDirtyState';
|
|
|
|
import {OfficialTheme} from './models/themes';
|
|
|
|
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
|
|
|
|
import {ServicesProvider} from './components/providers/ServiceProvider';
|
|
|
|
import {Toaster} from 'react-hot-toast';
|
2023-05-16 11:53:36 +05:30
|
|
|
|
2023-06-01 13:23:45 +05:30
|
|
|
interface AppProps {
|
|
|
|
ghostVersion: string;
|
2023-07-13 10:12:31 +09:00
|
|
|
officialThemes: OfficialTheme[];
|
2023-06-01 13:23:45 +05:30
|
|
|
}
|
|
|
|
|
2023-07-31 18:27:30 +01:00
|
|
|
const queryClient = new QueryClient();
|
|
|
|
|
2023-07-13 10:12:31 +09:00
|
|
|
function App({ghostVersion, officialThemes}: AppProps) {
|
2023-05-16 11:53:36 +05:30
|
|
|
return (
|
2023-07-31 18:27:30 +01:00
|
|
|
<QueryClientProvider client={queryClient}>
|
|
|
|
<ServicesProvider ghostVersion={ghostVersion} officialThemes={officialThemes}>
|
2023-08-03 09:29:14 +01:00
|
|
|
<GlobalDataProvider>
|
2023-07-31 18:27:30 +01:00
|
|
|
<RoutingProvider>
|
|
|
|
<GlobalDirtyStateProvider>
|
|
|
|
<div className="admin-x-settings h-[100vh] w-full overflow-y-auto" id="admin-x-root" style={{
|
2023-08-02 08:37:51 +01:00
|
|
|
height: '100vh',
|
|
|
|
width: '100%'
|
|
|
|
}}
|
2023-07-31 18:27:30 +01:00
|
|
|
>
|
|
|
|
<Toaster />
|
|
|
|
<NiceModal.Provider>
|
|
|
|
<div className='fixed left-6 top-4 z-20'>
|
|
|
|
<ExitSettingsButton />
|
|
|
|
</div>
|
2023-05-16 11:53:36 +05:30
|
|
|
|
2023-07-31 18:27:30 +01:00
|
|
|
{/* Main container */}
|
|
|
|
<div className="mx-auto flex max-w-[1080px] flex-col px-[5vmin] py-[12vmin] md:flex-row md:items-start md:gap-x-10 md:py-[8vmin]" id="admin-x-settings-content">
|
2023-05-16 11:53:36 +05:30
|
|
|
|
2023-07-31 18:27:30 +01:00
|
|
|
{/* Sidebar */}
|
|
|
|
<div className="relative z-20 min-w-[260px] grow-0 md:fixed md:top-[8vmin] md:basis-[260px]">
|
|
|
|
<div className='h-[84px]'>
|
|
|
|
<Heading>Settings</Heading>
|
|
|
|
</div>
|
|
|
|
<div className="relative mt-[-32px] w-[260px] overflow-x-hidden after:absolute after:inset-x-0 after:top-0 after:block after:h-[40px] after:bg-gradient-to-b after:from-white after:to-transparent after:content-['']">
|
|
|
|
<Sidebar />
|
|
|
|
</div>
|
2023-07-04 20:26:46 +05:30
|
|
|
</div>
|
2023-07-31 18:27:30 +01:00
|
|
|
<div className="relative flex-auto pt-[3vmin] md:ml-[300px] md:pt-[85px]">
|
|
|
|
<div className='pointer-events-none fixed inset-x-0 top-0 z-[5] h-[130px] bg-gradient-to-t from-transparent to-white to-60%'></div>
|
|
|
|
<Settings />
|
2023-07-04 20:26:46 +05:30
|
|
|
</div>
|
2023-06-20 12:58:44 +10:00
|
|
|
</div>
|
2023-07-31 18:27:30 +01:00
|
|
|
</NiceModal.Provider>
|
|
|
|
</div>
|
|
|
|
</GlobalDirtyStateProvider>
|
|
|
|
</RoutingProvider>
|
2023-08-03 09:29:14 +01:00
|
|
|
</GlobalDataProvider>
|
2023-07-31 18:27:30 +01:00
|
|
|
</ServicesProvider>
|
|
|
|
</QueryClientProvider>
|
2023-05-16 11:53:36 +05:30
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|