@@ -100,7 +100,7 @@ export function ExampleView({ example }: Props) {
100
100
< div
101
101
className = { cs (
102
102
'flex-1 grid gap-4' ,
103
- codeEditorShowing ? 'md:grid-rows-2 ' : '' ,
103
+ codeEditorShowing ? 'md:grid-rows-[2fr_3fr] ' : '' ,
104
104
) }
105
105
>
106
106
{ isGPUSupported ? (
@@ -133,29 +133,39 @@ export function ExampleView({ example }: Props) {
133
133
'absolute bg-tameplum-50 z-20 md:relative h-[calc(100%-2rem)] w-[calc(100%-2rem)] md:w-full md:h-full' ,
134
134
) }
135
135
>
136
- < div className = "absolute inset-1" >
137
- < div className = "flex overflow-auto border-gray-300 pt-16 md:pt-0" >
138
- { editorTabsList . map ( ( fileName ) => (
139
- < button
140
- key = { fileName }
141
- type = "button"
142
- onClick = { ( ) => setCurrentFile ( fileName ) }
143
- className = { cs (
144
- 'px-4 py-2' ,
145
- currentFile === fileName
146
- ? 'rounded-t-lg rounded-bl-none rounded-br-none bg-gradient-to-br from-gradient-purple to-gradient-blue text-white hover:from-gradient-purple-dark hover:to-gradient-blue-dark'
147
- : 'rounded-t-lg rounded-bl-none rounded-br-none bg-white border-tameplum-100 border-2 hover:bg-tameplum-20' ,
148
- ) }
149
- >
150
- { fileName }
151
- </ button >
152
- ) ) }
136
+ < div className = "absolute inset-0 flex flex-col justify-between" >
137
+ < div className = "h-12 pt-16 md:pt-0" >
138
+ < div className = "flex overflow-x-auto border-gray-300 h-full" >
139
+ { editorTabsList . map ( ( fileName ) => (
140
+ < button
141
+ key = { fileName }
142
+ type = "button"
143
+ onClick = { ( ) => setCurrentFile ( fileName ) }
144
+ className = { cs (
145
+ 'px-4 rounded-t-lg rounded-b-none text-nowrap' ,
146
+ currentFile === fileName
147
+ ? 'bg-gradient-to-br from-gradient-purple to-gradient-blue text-white hover:from-gradient-purple-dark hover:to-gradient-blue-dark'
148
+ : 'bg-white border-tameplum-100 border-2 hover:bg-tameplum-20' ,
149
+ ) }
150
+ >
151
+ { fileName }
152
+ </ button >
153
+ ) ) }
154
+ </ div >
153
155
</ div >
154
- { currentFile === 'index.html' ? (
155
- < HtmlCodeEditor shown code = { htmlCode } />
156
- ) : (
157
- < TsCodeEditor shown code = { tsCodes [ currentFile ] } />
158
- ) }
156
+
157
+ < HtmlCodeEditor
158
+ shown = { currentFile === 'index.html' }
159
+ code = { htmlCode }
160
+ />
161
+
162
+ { Object . entries ( tsCodes ) . map ( ( [ key , value ] ) => (
163
+ < TsCodeEditor
164
+ shown = { key === currentFile }
165
+ code = { value }
166
+ key = { key }
167
+ />
168
+ ) ) }
159
169
</ div >
160
170
</ div >
161
171
) : null }
0 commit comments