1
1
import { components , ApiOptions , ClassNames } from "@khanacademy/perseus" ;
2
+ import { View } from "@khanacademy/wonder-blocks-core" ;
3
+ import { Checkbox } from "@khanacademy/wonder-blocks-form" ;
4
+ import { spacing } from "@khanacademy/wonder-blocks-tokens" ;
2
5
import * as React from "react" ;
3
6
import invariant from "tiny-invariant" ;
4
7
import _ from "underscore" ;
@@ -180,19 +183,21 @@ class EditorPage extends React.Component<Props, State> {
180
183
181
184
return (
182
185
< div id = "perseus" className = { className } >
183
- < div style = { { marginBottom : 10 } } >
186
+ < View
187
+ style = { {
188
+ marginBottom : 10 ,
189
+ height : 30 ,
190
+ flexDirection : "row" ,
191
+ gap : spacing . medium_16 ,
192
+ alignItems : "center" ,
193
+ } }
194
+ >
184
195
{ this . props . developerMode && (
185
- < span >
186
- < label >
187
- { " " }
188
- Developer JSON Mode:{ " " }
189
- < input
190
- type = "checkbox"
191
- checked = { this . props . jsonMode }
192
- onChange = { this . toggleJsonMode }
193
- />
194
- </ label > { " " }
195
- </ span >
196
+ < Checkbox
197
+ label = "Developer JSON Mode"
198
+ checked = { this . props . jsonMode }
199
+ onChange = { this . toggleJsonMode }
200
+ />
196
201
) }
197
202
198
203
{ ! this . props . jsonMode && (
@@ -205,6 +210,11 @@ class EditorPage extends React.Component<Props, State> {
205
210
) }
206
211
207
212
{ ! this . props . jsonMode && (
213
+ // NOTE: This component positions itself using fixed
214
+ // positioning, so even though it appears here, near
215
+ // the JSON Mode and Viewport Resizer elements, it
216
+ // shows up in a completely different place on the page
217
+ // visually.
208
218
< HUD
209
219
message = "Style warnings"
210
220
enabled = { this . state . highlightLint }
@@ -215,7 +225,7 @@ class EditorPage extends React.Component<Props, State> {
215
225
} }
216
226
/>
217
227
) }
218
- </ div >
228
+ </ View >
219
229
220
230
{ this . props . developerMode && this . props . jsonMode && (
221
231
< div >
0 commit comments