diff --git a/frontend/src/components/TopicCard/Desc.js b/frontend/src/components/TopicCard/Desc.js
index 2cb665cb..db17a6b7 100644
--- a/frontend/src/components/TopicCard/Desc.js
+++ b/frontend/src/components/TopicCard/Desc.js
@@ -31,8 +31,7 @@ class Desc extends Component {
? '
'
: Util.mdToHTML(this.props.desc)
- const htmlSpan =
-
+ if (this.props.authorizedToEdit) {
return (
@@ -58,6 +57,17 @@ class Desc extends Component {
)
+ } else {
+ return (
+
+
+
+ {this.props.desc}
+
+
+
+ )
+ }
}
}
diff --git a/frontend/src/components/TopicCard/Title.js b/frontend/src/components/TopicCard/Title.js
index 4981b561..77f153b4 100644
--- a/frontend/src/components/TopicCard/Title.js
+++ b/frontend/src/components/TopicCard/Title.js
@@ -2,32 +2,43 @@ import React from 'react'
import { RIETextArea } from 'riek'
const Title = (props) => {
- return (
-
- {
- const ENTER = 13
- if (e.which === ENTER) {
- e.preventDefault()
- props.onChange({ name: e.target.value })
- }
- }
- }}
- />
-
- )
+ if (props.authorizedToEdit) {
+ return (
+
+ {
+ const ENTER = 13
+ if (e.which === ENTER) {
+ e.preventDefault()
+ props.onChange({ name: e.target.value })
+ }
+ }
+ }}
+ />
+
+ )
+ } else {
+ return (
+
+
+ {props.name}
+
+
+ )
+ }
}
/*
* Title.propTypes = {
* name: PropTypes.string,
- * onChange: PropTypes.func
+ * onChange: PropTypes.func,
+ * authorizedToEdit: PropTypes.bool
* }
*/
diff --git a/frontend/src/components/TopicCard/index.js b/frontend/src/components/TopicCard/index.js
index 8af548c7..9b8a2940 100644
--- a/frontend/src/components/TopicCard/index.js
+++ b/frontend/src/components/TopicCard/index.js
@@ -23,7 +23,10 @@ class ReactTopicCard extends Component {
return (