diff --git a/src/components/Category.jsx b/src/components/Category.jsx index 45021ed..cad7600 100644 --- a/src/components/Category.jsx +++ b/src/components/Category.jsx @@ -69,7 +69,7 @@ export class Category extends Component {
{item.title} {/* */} - {htmlReactParser(item.description)} + {htmlReactParser(item.description)}
{item.views} Views diff --git a/src/components/article/AllArticlesComponents.jsx b/src/components/article/AllArticlesComponents.jsx index 215c45e..d88b877 100644 --- a/src/components/article/AllArticlesComponents.jsx +++ b/src/components/article/AllArticlesComponents.jsx @@ -110,54 +110,59 @@ export class AllArticles extends Component {
{ - (allArticle = arr.map(item => ( - -
- articleImage -
- -
-

{reactParser(item.title)}

-
-
-

{reactParser(item.description)}

-
-
-
- {decodedToken !== undefined && - decodedToken.id === item.authorid ? ( -
- - - + (allArticle = arr.map(item => + decodedToken !== undefined && + decodedToken.id === item.authorid ? ( + +
+ articleImage +
+ +
+

{reactParser(item.title)}

- ) : ( - '' - )} +
+

{reactParser(item.description)}

+
+
+
+ {decodedToken !== undefined && + decodedToken.id === item.authorid ? ( +
+ + + +
+ ) : ( + '' + )} +
-
- - ))) + + ) : ( + '' + ), + )) }
diff --git a/src/components/article/ArticleForm.jsx b/src/components/article/ArticleForm.jsx index 5a632bf..3c80bb9 100644 --- a/src/components/article/ArticleForm.jsx +++ b/src/components/article/ArticleForm.jsx @@ -9,6 +9,7 @@ /* eslint-disable dot-notation */ /* eslint-disable no-return-assign */ import React from 'react'; +// import decodeToken from 'jwt-decode'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faImage } from '@fortawesome/free-solid-svg-icons'; import { connect } from 'react-redux'; @@ -197,6 +198,9 @@ export class Editor extends React.Component { * @returns {*} editor */ render() { + // const token = localStorage.getItem('token'); + // const decode = decodeToken(token); + // console.log(decode); const { tagInputs } = this.state; let id = 1; const { articleCategory } = this.props.articleCategories; diff --git a/src/components/comment/commentForm.jsx b/src/components/comment/commentForm.jsx index 58abc3c..fe73049 100644 --- a/src/components/comment/commentForm.jsx +++ b/src/components/comment/commentForm.jsx @@ -1,5 +1,6 @@ /* eslint-disable require-jsdoc */ import React, { Component } from 'react'; +import decodeToken from 'jwt-decode'; import TextArea from '../common/textArea'; import SubmitButton from '../common/SubmitButton'; @@ -16,7 +17,12 @@ class CommentForm extends Component { } handleChange = e => { + // const desabledTextarea = document.getElementById('disabledTexarea'); + // if (desabledTextarea) { + // desabledTextarea.desabled = true; + // } else { this.setState({ [e.target.name]: e.target.value }); + // } }; handleSubmit = e => { @@ -31,20 +37,34 @@ class CommentForm extends Component { }; render() { + const decodedToken = decodeToken(localStorage.getItem('token')); const { comment } = this.state; const { buttonLabel } = this.props; return (
-
-