From 2b65ee76460fb41969dcf8643d5719439346ae26 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Thu, 19 May 2022 05:49:19 +0430 Subject: added icons for save,load,delete --- spring-front/src/App.js | 3 +++ spring-front/src/components/Editor.js | 16 +++++++++++++--- spring-front/src/index.css | 5 +++++ 3 files changed, 21 insertions(+), 3 deletions(-) (limited to 'spring-front') diff --git a/spring-front/src/App.js b/spring-front/src/App.js index e965d51..a91418e 100644 --- a/spring-front/src/App.js +++ b/spring-front/src/App.js @@ -10,6 +10,9 @@ export default class App extends React.Component { return (
+ + +
); } diff --git a/spring-front/src/components/Editor.js b/spring-front/src/components/Editor.js index 3f8fefb..eee31a9 100644 --- a/spring-front/src/components/Editor.js +++ b/spring-front/src/components/Editor.js @@ -26,7 +26,7 @@ const md = new mit({ html: true }) .use(mittexmath, { engine: katex, delimiters: "gitlab", - katexOptions: { macros: { "\\RR": "\\mathbb{R}" }, output: "mathml" }, + katexOptions: { output: "mathml" }, }) .use(mitmmdtable) .use(mithljs, { inline: true, auto: true, code: true, hljs: hljs }); @@ -41,7 +41,8 @@ export default class Editor extends React.Component { this.updateCodeSyntaxHighlighting.bind(this); this.handleChange = this.handleChange.bind(this); this.parseMarkdown = this.parseMarkdown.bind(this); - this.state = { value: "" }; + this.handleTitleClick = this.handleTitleClick.bind(this); + this.state = { value: "", drawerActive: false }; // this.hljs_worker = new Worker("../highlight_worker.js"); // this.md_worker = new Worker("../parse_worker.js"); } @@ -112,7 +113,13 @@ export default class Editor extends React.Component { } } + handleTitleClick() { + this.setState((prevState) => ({ drawerActive: !prevState.drawerActive })); + } + render() { + const { markdownText, drawerTitle, drawerChildren } = this.props; + const drawerStyles = this.state.drawerActive ? "is-expanded" : ""; return (
@@ -134,7 +141,10 @@ export default class Editor extends React.Component { onScroll={this.handleScroll.bind(this)} onKeyDown={this.handleKeyDown.bind(this)} direction="rtl" - > + tabIndex="0" + > + {markdownText} +
diff --git a/spring-front/src/index.css b/spring-front/src/index.css index 942cb96..159a28e 100644 --- a/spring-front/src/index.css +++ b/spring-front/src/index.css @@ -100,3 +100,8 @@ code { white-space: pre-wrap; overflow-y: auto; } + +.icon { + z-index: 2; + position: relative; +} -- cgit v1.2.3