2023-05-23 11:30:38 +02:00
|
|
|
import Button from './admin-x-ds/global/Button';
|
2023-05-25 15:59:27 +05:30
|
|
|
import DataProvider from './components/providers/DataProvider';
|
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-05-16 11:53:36 +05:30
|
|
|
import Settings from './components/Settings';
|
|
|
|
import Sidebar from './components/Sidebar';
|
2023-06-20 12:58:44 +10:00
|
|
|
import {GlobalDirtyStateProvider} from './hooks/useGlobalDirtyState';
|
2023-06-16 17:04:26 +05:30
|
|
|
import {OfficialTheme} from './models/themes';
|
2023-06-01 13:23:45 +05:30
|
|
|
import {ServicesProvider} from './components/providers/ServiceProvider';
|
2023-06-05 17:30:15 +02:00
|
|
|
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-06-16 17:04:26 +05:30
|
|
|
officialThemes: OfficialTheme[]
|
2023-06-20 12:58:44 +10:00
|
|
|
setDirty?: (dirty: boolean) => void;
|
2023-06-01 13:23:45 +05:30
|
|
|
}
|
|
|
|
|
2023-06-20 12:58:44 +10:00
|
|
|
function App({ghostVersion, officialThemes, setDirty}: AppProps) {
|
2023-05-16 11:53:36 +05:30
|
|
|
return (
|
2023-06-16 17:04:26 +05:30
|
|
|
<ServicesProvider ghostVersion={ghostVersion} officialThemes={officialThemes}>
|
2023-06-01 13:23:45 +05:30
|
|
|
<DataProvider>
|
2023-06-20 12:58:44 +10:00
|
|
|
<GlobalDirtyStateProvider setDirty={setDirty}>
|
|
|
|
<div className="admin-x-settings">
|
|
|
|
<Toaster />
|
|
|
|
<NiceModal.Provider>
|
|
|
|
<div className='fixed left-6 top-4'>
|
|
|
|
<Button label='← Done' link={true} onClick={() => window.history.back()} />
|
|
|
|
</div>
|
2023-05-16 11:53:36 +05:30
|
|
|
|
2023-06-20 12:58:44 +10: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]">
|
2023-05-16 11:53:36 +05:30
|
|
|
|
2023-06-20 12:58:44 +10:00
|
|
|
{/* Sidebar */}
|
|
|
|
<div className="relative min-w-[240px] grow-0 md:fixed md:top-[8vmin] md:basis-[240px]">
|
|
|
|
<div className='h-[84px]'>
|
|
|
|
<Heading>Settings</Heading>
|
|
|
|
</div>
|
|
|
|
<div className="relative mt-[-32px] w-[240px] 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-06-01 13:23:45 +05:30
|
|
|
</div>
|
2023-06-20 12:58:44 +10:00
|
|
|
<div className="flex-auto pt-[3vmin] md:ml-[280px] md:pt-[84px]">
|
|
|
|
<Settings />
|
2023-06-01 13:23:45 +05:30
|
|
|
</div>
|
2023-05-29 14:28:16 +05:30
|
|
|
</div>
|
2023-06-20 12:58:44 +10:00
|
|
|
</NiceModal.Provider>
|
|
|
|
</div>
|
|
|
|
</GlobalDirtyStateProvider>
|
2023-06-01 13:23:45 +05:30
|
|
|
</DataProvider>
|
|
|
|
</ServicesProvider>
|
2023-05-16 11:53:36 +05:30
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default App;
|