File tree Expand file tree Collapse file tree 2 files changed +25
-11
lines changed Expand file tree Collapse file tree 2 files changed +25
-11
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
3
import Tabs from './Tabs' ;
4
+ import Indentations from './Indentations' ;
4
5
5
6
6
7
@@ -10,26 +11,19 @@ export default function Formatter ({
10
11
11
12
let [ showOutput , setShowOutput ] = React . useState ( false ) ;
12
13
13
- let indentationItems = settings . indentations . map ( ( v , i ) => {
14
- return (
15
- < div className = "bg-white text-black text-sm cursor-pointer font-bold px-2 py-1 mr-1 duration-300 hover:bg-slate-700 hover:text-white" >
16
- { v . name }
17
- </ div >
18
- ) ;
19
- } ) ;
20
-
21
14
let tabsProps = {
22
15
showOutput, setShowOutput
23
16
} ;
17
+ let indentationsProps = {
18
+ settings
19
+ } ;
24
20
25
21
return (
26
22
< div className = "Formatter px-4 py-16 bg-slate-300" >
27
23
< div className = "max-w-4xl mx-auto shadow" >
28
24
< div className = "bg-slate-200 flex" >
29
25
< Tabs { ...tabsProps } />
30
- < div className = "flex px-4 py-4" >
31
- { indentationItems }
32
- </ div >
26
+ < Indentations { ...indentationsProps } />
33
27
</ div >
34
28
< div className = "bg-slate-100 px-4 py-4" >
35
29
< textarea name = "" id = "" cols = "30" rows = "10" className = "w-full border-2 border-slate-500" > </ textarea >
Original file line number Diff line number Diff line change
1
+
2
+
3
+
4
+ export default function Indentations ( {
5
+ settings
6
+ } ) {
7
+ let indentationItems = settings . indentations . map ( ( v , i ) => {
8
+ return (
9
+ < div className = "bg-white text-black text-sm cursor-pointer font-bold px-2 py-1 mr-1 duration-300 hover:bg-slate-700 hover:text-white" >
10
+ { v . name }
11
+ </ div >
12
+ ) ;
13
+ } ) ;
14
+
15
+ return (
16
+ < div className = "flex px-4 py-4" >
17
+ { indentationItems }
18
+ </ div >
19
+ ) ;
20
+ }
You can’t perform that action at this time.
0 commit comments