diff --git a/src/components/App.js b/src/components/App.js index ac7986f..1d8cb1a 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -4,6 +4,7 @@ import "./css/App.css"; import Navigation from './Navigation'; import Github from './Github'; import Articles from './Articles'; +import ArticleEditor from './ArticleEditor'; import About from './About'; import Intro from './Intro'; @@ -18,6 +19,7 @@ const App = (props) => { } /> + diff --git a/src/components/Article.js b/src/components/Article.js index eb46762..7013c1f 100644 --- a/src/components/Article.js +++ b/src/components/Article.js @@ -44,7 +44,6 @@ const Article = ({article}) => { /** * Given some text, processes and returns jsx with any link represented as an anchor */ - let output = [""]; // Stores all text in a list let loc = 0; // Stores the current location in output that we're working with @@ -80,7 +79,6 @@ const Article = ({article}) => { let tmp; let output = [""]; // Stores all text in a list let loc = 0; // Stores the current location in output that we're working with - for (let i = 0; i < text.length; i++) { // Iterate through the entire text string if (!React.isValidElement(text[i])) { tmp = [""]; @@ -116,6 +114,7 @@ const Article = ({article}) => { let tick=false; // used to check if we're currently in formatted text. let delimiters = ['', '`', '*', '~']; // Denotes characters used to format + for (let i = 0; i < text.length; i++) { // Iterate through input if (delimiters.indexOf(text[i]) !== -1) { // Detect Code Delimiter @@ -181,7 +180,7 @@ const Article = ({article}) => { }); }; - + return (
{ + const [content, setContent] = useState("Hello World"); + + let article = { + "id":"0", + "title": "Article Editor", + "desc":"This is a place to edit articles", + "contents": content + }; + + return ( +
+
+ {setContent(e.target.value)}}/> +
+ ); +}; + +export default ArticleEditor; \ No newline at end of file diff --git a/src/components/css/ArticleEditor.css b/src/components/css/ArticleEditor.css new file mode 100644 index 0000000..a356569 --- /dev/null +++ b/src/components/css/ArticleEditor.css @@ -0,0 +1,22 @@ +.ArticleEditor input { + width:100%; + height: 35vh; + border-style: solid; + border-color: lightgray; + border-radius: 2px; + border-width: 2px; + padding: 0.4em 0.4em 0.4em 0; + text-align: left; +} + +.article .open { + max-height:100vh; +} + +.article .Close { + max-height:100vh; +} + +.article { + max-height:100vh; +} \ No newline at end of file