release: v0.15.0 (#585)
Eighteen changes since v0.14.0. See CHANGELOG.md for the full list and the upgrade notes (bump IMAGE_CACHE_VERSION).
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import SettingsEditor from '../../components/SettingsEditor';
|
||||
|
||||
export default async function AdminSettingsSectionPage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ section: string }>;
|
||||
}) {
|
||||
const { section } = await params;
|
||||
return <SettingsEditor section={section} />;
|
||||
/**
|
||||
* The editor is rendered by the layout and reads the section from the URL
|
||||
* itself; this route only has to exist.
|
||||
*/
|
||||
export default function AdminSettingsSectionPage() {
|
||||
return null;
|
||||
}
|
||||
|
||||
19
app/admin/settings/layout.tsx
Normal file
19
app/admin/settings/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import SettingsEditor from '../components/SettingsEditor';
|
||||
|
||||
/**
|
||||
* The settings editor lives in the layout, not in the section pages.
|
||||
*
|
||||
* Each section is its own route, and a page remounts when the section changes.
|
||||
* With the editor in the page, switching from General to Theme threw away every
|
||||
* unsaved edit and re-read settings.yaml, without a word — the save bar simply
|
||||
* vanished. A layout stays mounted across its child routes, so the edits, and
|
||||
* the one save bar that covers them, survive the switch.
|
||||
*/
|
||||
export default function AdminSettingsLayout({ children }: { children: React.ReactNode }) {
|
||||
return (
|
||||
<>
|
||||
<SettingsEditor />
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
import SettingsEditor from '../components/SettingsEditor';
|
||||
|
||||
/** The editor is rendered by the layout; this route only has to exist. */
|
||||
export default function AdminSettingsPage() {
|
||||
return <SettingsEditor />;
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user