@@ -3,7 +3,16 @@ import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
3
3
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker' ;
4
4
import CompilerWorker from '../../src/workers/compiler?worker' ;
5
5
import FormatterWorker from '../../src/workers/formatter?worker' ;
6
- import { createEffect , createResource , createSignal , lazy , Suspense } from 'solid-js' ;
6
+ import {
7
+ createEffect ,
8
+ createResource ,
9
+ createSignal ,
10
+ lazy ,
11
+ onCleanup ,
12
+ onMount ,
13
+ ParentComponent ,
14
+ Suspense ,
15
+ } from 'solid-js' ;
7
16
import { useParams } from 'solid-app-router' ;
8
17
import { API , useAppContext } from '../context' ;
9
18
import createDebounce from '@solid-primitives/debounce' ;
@@ -55,6 +64,21 @@ const createTabList = () => {
55
64
return mapTabs ;
56
65
} ;
57
66
67
+ const RenderHeader : ParentComponent = ( props ) => {
68
+ onMount ( ( ) => {
69
+ const projectName = document . getElementById ( 'project-name' ) ! ;
70
+ const content = projectName . firstChild ! ;
71
+ content . remove ( ) ;
72
+ const children = props . children as HTMLElement ;
73
+ projectName . appendChild ( children ) ;
74
+ onCleanup ( ( ) => {
75
+ projectName . appendChild ( content ) ;
76
+ projectName . removeChild ( children ) ;
77
+ } ) ;
78
+ } ) ;
79
+ return < > </ > ;
80
+ } ;
81
+
58
82
export const Edit = ( props : { dark : boolean ; horizontal : boolean } ) => {
59
83
const compiler = new CompilerWorker ( ) ;
60
84
const formatter = new FormatterWorker ( ) ;
@@ -148,6 +172,9 @@ export const Edit = (props: { dark: boolean; horizontal: boolean }) => {
148
172
setCurrent = { setCurrent }
149
173
id = "repl"
150
174
/>
175
+ < RenderHeader >
176
+ < input class = "bg-transparent" value = { resource ( ) ?. repl ?. title || '' } />
177
+ </ RenderHeader >
151
178
</ Suspense >
152
179
) ;
153
180
} ;
0 commit comments