MCPcopy
hub / github.com/dabbott/react-native-express / codeHeight

Function codeHeight

components/EditorConsole.tsx:21–40  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

19}
20
21function codeHeight(code: string): number {
22 const headerHeight = 40
23 const footerHeight = 40
24 const lineHeight = 20
25 const padding = 4
26 const visualSpacer = 20 // To make things look nicer
27 const widgetHeight = 30
28 const widgetsHeight = countPlaygroundWidgets(code) * widgetHeight
29 const codeHeight = code.split('\n').length * lineHeight
30
31 return (
32 headerHeight +
33 padding +
34 codeHeight +
35 widgetsHeight +
36 visualSpacer +
37 padding +
38 footerHeight
39 )
40}
41
42interface Props {
43 variant?: 'slides'

Callers 1

EditorConsole.tsxFile · 0.85

Calls 1

countPlaygroundWidgetsFunction · 0.85

Tested by

no test coverage detected