-
-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathapp.js
More file actions
52 lines (48 loc) 路 1.18 KB
/
Copy pathapp.js
File metadata and controls
52 lines (48 loc) 路 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React from "react";
import CodeSurfer from "code-surfer";
import prismTheme from "prism-react-renderer/themes/duotoneLight";
const code = `
const App = () => (
<div style={{ height: 100 }}>
<CodeSurfer code={code} />
</div>
);
console.log();
`;
const App = () => (
<div
style={{
height: "100%",
display: "flex",
flexDirection: "column",
justifyContent: "center",
background: prismTheme.plain.backgroundColor,
border: `1px solid ${prismTheme.plain.color}`,
borderRadius: "3px",
boxSizing: "border-box"
}}
>
<div style={{ flex: 1 }} />
<CodeSurfer
code={code}
showNumbers
step={{ lines: [2] }}
theme={prismTheme}
/>
<div style={{ flex: 1 }} />
<div
style={{
padding: "10px",
overflow: "hidden",
font: `12px -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"`,
color: "#586069",
backgroundColor: "#f7f7f7",
borderTop: `1px solid ${prismTheme.plain.color}`,
borderRadius: "0 0 2px 2px"
}}
>
Foo
</div>
</div>
);
export default App;