@@ -3,7 +3,16 @@ import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
33import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker' ;
44import CompilerWorker from '../../src/workers/compiler?worker' ;
55import 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' ;
716import { useParams } from 'solid-app-router' ;
817import { API , useAppContext } from '../context' ;
918import createDebounce from '@solid-primitives/debounce' ;
@@ -55,6 +64,21 @@ const createTabList = () => {
5564 return mapTabs ;
5665} ;
5766
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+
5882export const Edit = ( props : { dark : boolean ; horizontal : boolean } ) => {
5983 const compiler = new CompilerWorker ( ) ;
6084 const formatter = new FormatterWorker ( ) ;
@@ -148,6 +172,9 @@ export const Edit = (props: { dark: boolean; horizontal: boolean }) => {
148172 setCurrent = { setCurrent }
149173 id = "repl"
150174 />
175+ < RenderHeader >
176+ < input class = "bg-transparent" value = { resource ( ) ?. repl ?. title || '' } />
177+ </ RenderHeader >
151178 </ Suspense >
152179 ) ;
153180} ;
0 commit comments