@@ -3,7 +3,6 @@ import ReactDOM from "react-dom";
3
3
import '../stylesheets/CodePreview.css' ;
4
4
//import MonacoEditor from 'react-monaco-editor';
5
5
import Editor from "@monaco-editor/react" ;
6
- // import { ClockLoader as Loader } from "react-spinners";
7
6
import AceEditor from 'react-ace' ;
8
7
import "ace-builds/src-noconflict/mode-javascript" ;
9
8
import "ace-builds/src-noconflict/theme-monokai" ;
@@ -12,16 +11,14 @@ import "ace-builds/src-noconflict/theme-github";
12
11
13
12
const CodePreview = ( ) => {
14
13
14
+ const [ theme , setTheme ] = useState ( "dark" ) ;
15
15
const [ tabState , setTabState ] = useState ( 1 ) ;
16
16
17
17
const toggleTab = ( tabNum ) => {
18
18
setTabState ( tabNum ) ;
19
19
}
20
20
21
-
22
- const [ theme , setTheme ] = useState ( "dark" ) ;
23
-
24
- function toggleTheme ( ) {
21
+ const toggleTheme = ( ) => {
25
22
// if (theme === 'dark') setTheme('monokai');
26
23
// setTheme('github');
27
24
setTheme ( theme === "dark" ? "monokai" : "github" ) ;
@@ -41,8 +38,27 @@ const CodePreview = () => {
41
38
42
39
43
40
return (
44
-
41
+
45
42
< div className = "codePreviewContainer" >
43
+
44
+ < div class = "mb-4 border-b border-gray-200 dark:border-gray-700" >
45
+ < ul class = "flex flex-wrap -mb-px" id = "myTab" data-tabs-toggle = "#myTabContent" role = "tablist" >
46
+
47
+ < li class = "mr-2" role = "presentation" >
48
+ < button class = "inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300" id = "code-editor-tab" data-tabs-target = "#code-editor" type = "button" role = "tab" aria-controls = "code-editor" aria-selected = "false" > Code Preview</ button >
49
+ </ li >
50
+
51
+ < li class = "mr-2" role = "presentation" >
52
+ < button class = "inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300 active" id = "dashboard-tab" data-tabs-target = "#dashboard" type = "button" role = "tab" aria-controls = "dashboard" aria-selected = "true" > Terminal</ button >
53
+ </ li >
54
+
55
+ < li class = "mr-2" role = "presentation" >
56
+ < button class = "inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300" id = "settings-tab" data-tabs-target = "#settings" type = "button" role = "tab" aria-controls = "settings" aria-selected = "false" > CSS Editor</ button >
57
+ </ li >
58
+
59
+ </ ul >
60
+ </ div >
61
+
46
62
< div className = "tabContainer" >
47
63
< button
48
64
className = { tabState === 1 ? "tabs active-tabs" : "tabs" }
@@ -56,6 +72,9 @@ const CodePreview = () => {
56
72
</ div >
57
73
< div className = "contentContainer" >
58
74
< div className = { tabState === 1 ? "content active-content" : "content" } > < div className = "codeEditorContainer" >
75
+
76
+
77
+
59
78
{ /* <Editor
60
79
height="80vh"
61
80
defaultLanguage="javascript"
@@ -109,7 +128,9 @@ const CodePreview = () => {
109
128
</ div >
110
129
</ div >
111
130
< div className = { tabState === 2 ? "content active-content" : "content" } >
112
- </ div >
131
+ </ div >
132
+
133
+
113
134
< div className = { tabState === 3 ? "content active-content" : "content" } > < div className = "codeEditorContainer" >
114
135
< Editor
115
136
height = "80vh"
@@ -125,6 +146,7 @@ const CodePreview = () => {
125
146
wordWrap : "on" ,
126
147
} }
127
148
/>
149
+
128
150
</ div > </ div >
129
151
</ div >
130
152
{ /* <div className='code-compiler'>
0 commit comments