Add computer settings pages and restore workspace pages
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import type { ReactNode } from "react";
|
||||
import Row from "@moduletrace/twui/layout/Row";
|
||||
import Stack from "@moduletrace/twui/layout/Stack";
|
||||
import H1 from "@moduletrace/twui/layout/H1";
|
||||
@@ -6,13 +7,21 @@ import Span from "@moduletrace/twui/layout/Span";
|
||||
type Props = {
|
||||
title: string;
|
||||
description: string;
|
||||
/**
|
||||
* Controls at the end of the header, e.g. a settings link.
|
||||
*/
|
||||
action?: ReactNode;
|
||||
};
|
||||
|
||||
/**
|
||||
* Same 64px header as a conversation, so moving between bots and settings
|
||||
* doesn't shift the page.
|
||||
*/
|
||||
export default function SettingsPaneHeader({ title, description }: Props) {
|
||||
export default function SettingsPaneHeader({
|
||||
title,
|
||||
description,
|
||||
action,
|
||||
}: Props) {
|
||||
return (
|
||||
<Row className="h-16 shrink-0 gap-3! flex-nowrap items-center px-6 border-0 border-b border-solid border-hairline">
|
||||
<Stack className="min-w-0 gap-0!">
|
||||
@@ -23,6 +32,11 @@ export default function SettingsPaneHeader({ title, description }: Props) {
|
||||
{description}
|
||||
</Span>
|
||||
</Stack>
|
||||
{action ? (
|
||||
<Row className="ml-auto shrink-0 gap-1! flex-nowrap justify-end">
|
||||
{action}
|
||||
</Row>
|
||||
) : null}
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,10 @@ type Props = {
|
||||
* A nested record page's name, for its breadcrumb trail.
|
||||
*/
|
||||
breadcrumb_title?: string;
|
||||
/**
|
||||
* Controls at the end of the pane header, e.g. a settings link.
|
||||
*/
|
||||
action?: ReactNode;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -28,10 +32,15 @@ export default function SettingsShell({
|
||||
children,
|
||||
wide,
|
||||
breadcrumb_title,
|
||||
action,
|
||||
}: Props) {
|
||||
return (
|
||||
<Stack className="grow min-w-0 h-full gap-0! items-stretch">
|
||||
<SettingsPaneHeader title={title} description={description} />
|
||||
<SettingsPaneHeader
|
||||
title={title}
|
||||
description={description}
|
||||
action={action}
|
||||
/>
|
||||
<Stack className="grow min-h-0 overflow-y-auto gap-0! items-stretch">
|
||||
<Stack
|
||||
className={twMerge(
|
||||
|
||||
Reference in New Issue
Block a user