11import React , { useReducer , useMemo , useCallback } from "react" ;
22import styled from "@emotion/styled" ;
33import { EditorPreferenceTree } from "./editor-preference-tree" ;
4- import routes from "./k/routes" ;
4+ import initial_routes from "./k/routes" ;
55import type { Action , Dispatcher , PreferenceState } from "./core" ;
66import { reducer } from "./reducers" ;
77import { Router } from "./router" ;
@@ -55,8 +55,9 @@ export function EditorPreference({ children }: React.PropsWithChildren<{}>) {
5555
5656 const [ state , dispatch ] = useReducer ( reducer , {
5757 open : false ,
58- route : "general" ,
59- routes : routes ,
58+ route : "/editor" ,
59+ routes : initial_routes ,
60+ renderers : { } ,
6061 config : pref ,
6162 } ) ;
6263
@@ -78,7 +79,7 @@ export function EditorPreference({ children }: React.PropsWithChildren<{}>) {
7879
7980function Preferences ( ) {
8081 const state = usePreferences ( ) ;
81- const { route } = state ;
82+ const { route, renderers } = state ;
8283
8384 const dispatch = useDispatch ( ) ;
8485
@@ -103,7 +104,7 @@ function Preferences() {
103104 textTransform = { "capitalize" }
104105 />
105106 </ ContentHeader >
106- < Router />
107+ < Router customRenderers = { renderers } />
107108 </ Content >
108109 </ Page >
109110 ) ;
0 commit comments