diff --git a/src/App.js b/src/App.js index c619ff8..cab10e7 100644 --- a/src/App.js +++ b/src/App.js @@ -7,8 +7,8 @@ function App() { return ( <> - - + {/* */} + {/* */} > ); } diff --git a/src/components/Modal/index.js b/src/components/Modal/index.js index 7ba578e..4962e01 100644 --- a/src/components/Modal/index.js +++ b/src/components/Modal/index.js @@ -3,9 +3,12 @@ import React, { useState } from "react"; import Button from "../Button"; import Tabbar from "../Tabbar"; -const Modal = ({ activeTab }) => { +const Modal = ({ activeTab, children }) => { const [openModal, setOpenModal] = useState(false); + // + // return ( { text={"ویرایش"} onClick={() => setOpenModal(true)} /> + {children} { iconHolderClassName={"mr-0"} onClick={() => setOpenModal(false)} /> - + { +// console.log("onChange", newValue); // eslint-disable-line no-console +// }; -class CodeEditor extends React.Component { - constructor() { - super(); - this.state = { - code: "// type your code... \n", - theme: "vs-light", - }; - } +// editorDidMount = (editor) => { +// // eslint-disable-next-line no-console +// console.log("editorDidMount", editor, editor.getValue(), editor.getModel()); +// this.editor = editor; +// }; - onChange = (newValue) => { - console.log("onChange", newValue); // eslint-disable-line no-console - }; +// changeEditorValue = () => { +// if (this.editor) { +// this.editor.setValue("// code changed! \n"); +// } +// }; - editorDidMount = (editor) => { - // eslint-disable-next-line no-console - console.log("editorDidMount", editor, editor.getValue(), editor.getModel()); - this.editor = editor; - }; +// changeBySetState = () => { +// this.setState({ code: "// code changed by setState! \n" }); +// }; - changeEditorValue = () => { - if (this.editor) { - this.editor.setValue("// code changed! \n"); - } - }; +// setDarkTheme = () => { +// this.setState({ theme: "vs-dark" }); +// }; - changeBySetState = () => { - this.setState({ code: "// code changed by setState! \n" }); - }; +// setLightTheme = () => { +// this.setState({ theme: "vs-light" }); +// }; - setDarkTheme = () => { - this.setState({ theme: "vs-dark" }); - }; +// render() { +// const { code, theme } = this.state; +// const options = { +// selectOnLineNumbers: true, +// roundedSelection: false, +// readOnly: false, +// cursorStyle: "line", +// automaticLayout: false, +// }; +// return ( +// +// +// +// Change value +// +// +// Change by setState +// +// +// Set dark theme +// +// +// Set light theme +// +// +// +// +// +// ); +// } +// } - setLightTheme = () => { - this.setState({ theme: "vs-light" }); - }; +// const ReactMonacoEditor = () => { +// return ( +// +// Monaco Editor Sample (controlled mode) +// +// +// Another editor (uncontrolled mode) +// {/* */} +// +// Another editor (showing a diff) +// {/* */} +// +// ); +// }; - render() { - const { code, theme } = this.state; - const options = { - selectOnLineNumbers: true, - roundedSelection: false, - readOnly: false, - cursorStyle: "line", - automaticLayout: false, - }; - return ( - - - - Change value - - - Change by setState - - - Set dark theme - - - Set light theme - - - - - - ); - } -} +// export default ReactMonacoEditor; + +import React from "react"; const ReactMonacoEditor = () => { - return ( - - Monaco Editor Sample (controlled mode) - - - Another editor (uncontrolled mode) - {/* */} - - Another editor (showing a diff) - {/* */} - - ); + return ReactMonacoEditor; }; export default ReactMonacoEditor; diff --git a/src/components/Tabbar/index.js b/src/components/Tabbar/index.js index abd259b..085be59 100644 --- a/src/components/Tabbar/index.js +++ b/src/components/Tabbar/index.js @@ -11,7 +11,7 @@ const Tabbar = ({ tabs }) => { const [activeTab, setActiveTab] = useState(); return ( - + {tabs.map((tab, index) => (