forked from oslabs-beta/QLens
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added CodeMirror, container, fixed Webpack
- Loading branch information
1 parent
065219d
commit 9741e88
Showing
16 changed files
with
134 additions
and
68 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +0,0 @@ | ||
// import React from 'react' | ||
|
||
// const ConvertToProgrammaticButton = () => { | ||
// return ( | ||
// <div> | ||
// </div> | ||
// ) | ||
// } | ||
|
||
// export default ConvertToProgrammaticButton; | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import Codemirror from 'codemirror'; | ||
import {UnControlled as CodeMirror} from 'react-codemirror2'; | ||
require('codemirror/mode/javascript/javascript'); | ||
import '../public/codemirror.css'; | ||
// import '../public/material.css'; | ||
// require('../../node_modules/codemirror/lib/codemirror.css'); | ||
import '../../node_modules/codemirror/lib/codemirror.css'; | ||
import '../../node_modules/codemirror/theme/dracula.css'; | ||
// import '../../node_modules/codemirror/lib/codemirror.css'; | ||
// import '../../node_modules/codemirror/theme/dracula.css'; | ||
|
||
const MongoSchemaIDE = ({schemaData}) => { | ||
console.log('from mongoIDE schemaData', schemaData) | ||
return( | ||
|
||
<div> | ||
<div className="codebox"> | ||
<CodeMirror | ||
value='<h1>hi</h1>' | ||
options={{ | ||
mode: 'javascript', | ||
theme: 'dracula', | ||
lineNumbers: true | ||
}} | ||
/> | ||
</div> | ||
<div className="codebox2"> | ||
<CodeMirror | ||
value='<h1>Judy with the BIGGGGGG booty! yasss queen! </h1>' | ||
options={{ | ||
mode: 'javascript', | ||
theme: 'dracula', | ||
lineNumbers: true | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default MongoSchemaIDE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// import React from 'react' | ||
import React, { useState, useEffect } from "react"; | ||
import MongoDBURI from '../Components/MongoDBURI'; | ||
import MongoSchemaIDE from '../Components/MongoSchemaIDE'; | ||
|
||
const Container = () => { | ||
const [schemaData, setSchemaData] = useState({}); | ||
const [uriId, setUriId] = useState(''); | ||
|
||
const submit = (e) => { | ||
e.preventDefault() | ||
console.log('submit worked') | ||
fetch('http://localhost:3000/getURI', { | ||
method: "POST", | ||
headers: { | ||
"Content-Type" : "application/json" | ||
}, | ||
body: JSON.stringify({val: 'mongodb+srv://judy:hush@hush.u9hai.mongodb.net/chat?retryWrites=true&w=majority'}) | ||
}) | ||
.then(res => res.json()) | ||
.then((data) => { | ||
console.log('data string from fetch', data) | ||
setSchemaData(JSON.parse(data)); | ||
}) | ||
.catch(err => console.log(err)) | ||
} | ||
|
||
//uriId = document.getElementById('uriInput').value; | ||
const getUri = (e) => { | ||
setUriId(e.target.value); | ||
}; | ||
|
||
console.log("state is being set", schemaData); | ||
|
||
return( | ||
<div> | ||
<MongoDBURI schemaData={schemaData} uriData={uriId} geturi={getUri} submitbtn={submit} /> | ||
<MongoSchemaIDE schemaData={schemaData} /> | ||
</div> | ||
) | ||
} | ||
|
||
export default Container; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.codebox { | ||
border: 1px solid black; | ||
width: 40%; | ||
display: inline-block; | ||
} | ||
|
||
.codebox2 { | ||
border: 1px solid black; | ||
width: 40%; | ||
display: inline-block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#logo { | ||
width: 15%; | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters