feat: 打通业务与页面编辑入口
This commit is contained in:
1 parent
d0ef25cfb3
commit
20eb160abf
3 files changed
+32
-5
No files matched your search
@@ -14,17 +14,20 @@ import {
|
||||
} from "antd";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { Link, useLocation } from "react-router-dom";
|
||||
import type { BrandProfile } from "@personal-brand/api-client";
|
||||
import { createApiClient } from "../../lib/api.js";
|
||||
import { AdminPageHeader } from "../../components/AdminPageHeader.js";
|
||||
import { ImageUrlField } from "../../components/ImageUrlField.js";
|
||||
import { MutationError, QueryState } from "../../components/QueryState.js";
|
||||
import { PresentationEditor } from "./PresentationEditor.js";
|
||||
import type { PreviewSelection } from "./preview-selection.js";
|
||||
import "./BrandPage.css";
|
||||
import { useEditorDraft } from "./use-editor-draft.js";
|
||||
|
||||
export function BrandPage() {
|
||||
const location = useLocation();
|
||||
const initialSelection = location.state as PreviewSelection | undefined;
|
||||
const [panel, setPanel] = useState("pages");
|
||||
const [dirty, setDirty] = useState(false);
|
||||
useEditorDraft(dirty);
|
||||
@@ -236,6 +239,7 @@ export function BrandPage() {
|
||||
brand={brand.data}
|
||||
loading={workspace.isLoading}
|
||||
error={workspace.error}
|
||||
{...(initialSelection ? { initialSelection } : {})}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user