refactor: adopt shared page and workspace layouts
This commit is contained in:
@@ -2,8 +2,7 @@ import { useMemo, useState } from "react";
|
||||
import { ExternalLink } from "lucide-react";
|
||||
import { Button } from "@govoplan/core-webui";
|
||||
import { Card } from "@govoplan/core-webui";
|
||||
import { PageScrollViewport } from "@govoplan/core-webui";
|
||||
import { PageTitle } from "@govoplan/core-webui";
|
||||
import { PageLayout, WorkspaceLayout } from "@govoplan/core-webui";
|
||||
import { FieldLabel } from "@govoplan/core-webui";
|
||||
import { StatusBadge, TableActionGroup, i18nMessage } from "@govoplan/core-webui";
|
||||
import { usePlatformLanguage } from "@govoplan/core-webui";
|
||||
@@ -137,20 +136,25 @@ export default function TemplatesPage() {
|
||||
|
||||
if (selectedTemplate) {
|
||||
return (
|
||||
<div className="workspace module-workspace">
|
||||
<ModuleSubnav active={active} groups={templateSubnav(() => setSelectedId(null))} onSelect={setActive} />
|
||||
<section className="workspace-content">
|
||||
<div className="content-pad workspace-data-page">
|
||||
<div className="page-heading split workspace-heading">
|
||||
<div>
|
||||
<PageTitle>{selectedTemplate.name}</PageTitle>
|
||||
<p>{selectedTemplate.description}</p>
|
||||
</div>
|
||||
<div className="button-row compact-actions">
|
||||
<WorkspaceLayout
|
||||
className="module-workspace"
|
||||
primary={<ModuleSubnav active={active} groups={templateSubnav(() => setSelectedId(null))} onSelect={setActive} />}
|
||||
primaryLabel="Template sections"
|
||||
contentLabel="Template workspace"
|
||||
interfaceId="campaign.template-workspace"
|
||||
helpModuleId="campaign"
|
||||
>
|
||||
<PageLayout
|
||||
mode="workspace"
|
||||
title={selectedTemplate.name}
|
||||
description={selectedTemplate.description}
|
||||
actions={
|
||||
<>
|
||||
<Button disabled>i18n:govoplan-campaign.duplicate.972d5737</Button>
|
||||
<Button variant="primary" disabled>i18n:govoplan-campaign.use_in_campaign.779163bc</Button>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
>
|
||||
|
||||
{active === "overview" && <TemplateOverview template={selectedTemplate} />}
|
||||
{active === "content" && <TemplateContent template={selectedTemplate} />}
|
||||
@@ -158,25 +162,23 @@ export default function TemplatesPage() {
|
||||
{active === "preview" && <TemplatePreview template={selectedTemplate} />}
|
||||
{active === "usage" && <TemplateUsage template={selectedTemplate} />}
|
||||
{active === "versions" && <TemplateVersions template={selectedTemplate} />}
|
||||
</div>
|
||||
</section>
|
||||
</div>);
|
||||
</PageLayout>
|
||||
</WorkspaceLayout>);
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
<PageScrollViewport>
|
||||
<div className="content-pad workspace-data-page module-entry-page">
|
||||
<div className="page-heading split workspace-heading">
|
||||
<div>
|
||||
<PageTitle>i18n:govoplan-campaign.templates.f25b700e</PageTitle>
|
||||
<p>i18n:govoplan-campaign.reusable_message_templates_open_a_template_to_ed.792e2afb</p>
|
||||
</div>
|
||||
<div className="button-row compact-actions">
|
||||
<PageLayout
|
||||
className="module-entry-page"
|
||||
title="i18n:govoplan-campaign.templates.f25b700e"
|
||||
description="i18n:govoplan-campaign.reusable_message_templates_open_a_template_to_ed.792e2afb"
|
||||
actions={
|
||||
<>
|
||||
<Button disabled>i18n:govoplan-campaign.import.d6fbc9d2</Button>
|
||||
<Button variant="primary" disabled>i18n:govoplan-campaign.export.f3e4fadb</Button>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
}
|
||||
>
|
||||
|
||||
<Card
|
||||
title={
|
||||
@@ -196,8 +198,7 @@ export default function TemplatesPage() {
|
||||
className="compact-table-wrap module-table-wrap module-entry-table" />
|
||||
|
||||
</Card>
|
||||
</div>
|
||||
</PageScrollViewport>);
|
||||
</PageLayout>);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user