{question.questionText.split('\n').map((line, idx) => (
{line}
))}
- {question.codeSnippet ? (
-
- {question.codeSnippet.split('\n').map((line, idx) => (
- {line}
- ))}
-
) : null}
+ {snippet}
{tags}
Votes: {question.votes}
diff --git a/src/client/app/QuestionFormComponent.jsx b/src/client/app/QuestionFormComponent.jsx
index f2afc7a..40819e3 100644
--- a/src/client/app/QuestionFormComponent.jsx
+++ b/src/client/app/QuestionFormComponent.jsx
@@ -22,6 +22,7 @@ class QuestionFormComponent extends React.Component {
appliedTags: this.props.question ? this.props.question.tags : [],
dialogOpen: false,
showCode: false,
+ showButtonText: this.props.question ? 'Show Code' : 'Add some code',
};
this.handleInputChange = this.handleInputChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
@@ -37,8 +38,6 @@ class QuestionFormComponent extends React.Component {
const target = event.target;
const value = target.value;
const name = target.name;
- console.log(`{${name}: ${value}}`);
-
this.setState({
[name]: value,
});
@@ -53,9 +52,8 @@ class QuestionFormComponent extends React.Component {
if (this.props.user.role === 'admin') {
this.openDialog();
return;
- } else {
- return;
}
+ return;
}
this.confirmNewTag();
}
@@ -94,6 +92,7 @@ class QuestionFormComponent extends React.Component {
questionText: '',
codeSnippet: '',
appliedTags: [],
+ showCode: false,
});
this.refs.tagBar.setState({ searchText: '' });
}
@@ -148,7 +147,7 @@ class QuestionFormComponent extends React.Component {
floatingLabelText="Ask a question..."
onChange={this.handleInputChange} />
{this.state.showCode ? codeZone : null}
diff --git a/src/client/codemirror.css b/src/client/codemirror.css
index 559682d..7f753ec 100644
--- a/src/client/codemirror.css
+++ b/src/client/codemirror.css
@@ -3,7 +3,12 @@
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
+<<<<<<< HEAD
height: auto;
+=======
+ height: 100px;
+ height: 150px;
+>>>>>>> syntax highlighting in forms and questions
color: black;
}