Skip to content

Commit e39f187

Browse files
rm unused pages
1 parent aa8990d commit e39f187

4 files changed

Lines changed: 47 additions & 428 deletions

File tree

editor/pages/files/[key]/[id].tsx

Lines changed: 0 additions & 122 deletions
This file was deleted.

editor/pages/files/[key]/index.tsx

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { SigninToContinueBannerPrmoptProvider } from "components/prompt-banner-s
44
import { Editor, EditorDefaultProviders } from "scaffolds/editor";
55
import { EditorSnapshot, StateProvider } from "core/states";
66
import { WorkspaceAction } from "core/actions";
7-
import { useDesignFile } from "hooks";
7+
import { useDesign, useDesignFile } from "hooks";
88

99
import { warmup } from "scaffolds/editor";
1010

1111
export default function FileEntryEditor() {
1212
const router = useRouter();
13-
const { key } = router.query;
13+
const { key, node } = router.query;
1414
const filekey = key as string;
15+
const nodeid = node as string;
1516

1617
const [loading, setLoading] = useState<boolean>(true);
1718

@@ -111,3 +112,47 @@ export default function FileEntryEditor() {
111112
</SigninToContinueBannerPrmoptProvider>
112113
);
113114
}
115+
116+
/**
117+
* TODO: support single design fetching
118+
// if target node is provided from query, use it.
119+
const design = useDesign({
120+
type: "use-file-node-id",
121+
file: filekey,
122+
node: nodeid,
123+
});
124+
125+
126+
useEffect(() => {
127+
if (!loading) {
128+
// if already loaded, ignore target node change.
129+
return;
130+
}
131+
if (design) {
132+
if (initialState.type === "success") return;
133+
initialDispatcher({
134+
type: "set",
135+
value: warmup.initializeDesign(design),
136+
});
137+
}
138+
}, [design, router.query, loading]);
139+
140+
// under main hook
141+
if (design) {
142+
const initialState = warmup.initializeDesign(design);
143+
val = {
144+
...initialState,
145+
design: {
146+
...initialState.design,
147+
pages: pages,
148+
},
149+
selectedPage: warmup.selectedPage(
150+
prevstate,
151+
pages,
152+
initialState.selectedNodes
153+
),
154+
};
155+
} else {
156+
157+
}
158+
*/

editor/pages/to-code/index.tsx

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)