Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
help_text renders markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
GraysonNull committed Mar 6, 2020
1 parent 05f2156 commit 5acc8ad
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
13 changes: 12 additions & 1 deletion web/init/src/components/config_render/ConfigCheckbox.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import Markdown from "react-remarkable";

export default class ConfigCheckbox extends React.Component {

Expand Down Expand Up @@ -44,7 +45,17 @@ export default class ConfigCheckbox extends React.Component {
<span className="field-label recommended">Recommended</span> :
null}
</label>
{this.props.help_text !== "" ? <p className="field-section-help-text u-marginTop--small u-lineHeight--normal u-marginLeft--small">{this.props.help_text}</p> : null}
{this.props.help_text !== "" ?
<p className="field-section-help-text u-marginTop--small u-lineHeight--normal u-marginLeft--small">
<Markdown
options={{
linkTarget: "_blank",
linkify: true,
}}>
{this.props.help_text}
</Markdown>
</p>
: null}
</div>
</div>
</div>
Expand Down
13 changes: 12 additions & 1 deletion web/init/src/components/config_render/ConfigInput.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import ConfigItemTitle from "./ConfigItemTitle";
import Markdown from "react-remarkable";

export default class ConfigInput extends React.Component {

Expand Down Expand Up @@ -58,7 +59,17 @@ export default class ConfigInput extends React.Component {
error={this.props.error}
/>
: null}
{this.props.help_text !== "" ? <p className="field-section-help-text u-marginTop--small u-lineHeight--normal">{this.props.help_text}</p> : null}
{this.props.help_text !== "" ?
<p className="field-section-help-text u-marginTop--small u-lineHeight--normal u-marginLeft--small">
<Markdown
options={{
linkTarget: "_blank",
linkify: true,
}}>
{this.props.help_text}
</Markdown>
</p>
: null}
<div className="field-input-wrapper u-marginTop--15">
<input
ref={this.inputRef}
Expand Down
13 changes: 12 additions & 1 deletion web/init/src/components/config_render/ConfigSelectOne.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import isEmpty from "lodash/isEmpty";

import ConfigItemTitle from "./ConfigItemTitle";
import ConfigRadio from "./ConfigRadio";
import Markdown from "react-remarkable";

export default class ConfigSelectOne extends React.Component {

Expand Down Expand Up @@ -45,7 +46,17 @@ export default class ConfigSelectOne extends React.Component {
error={this.props.error}
/>
: null}
{this.props.help_text !== "" ? <p className="field-section-help-text u-marginTop--small u-lineHeight--normal">{this.props.help_text}</p> : null}
{this.props.help_text !== "" ?
<p className="field-section-help-text u-marginTop--small u-lineHeight--normal u-marginLeft--small">
<Markdown
options={{
linkTarget: "_blank",
linkify: true,
}}>
{this.props.help_text}
</Markdown>
</p>
: null}
<div className="field-input-wrapper u-marginTop--15 flex flexWrap--wrap">
{options}
</div>
Expand Down
13 changes: 12 additions & 1 deletion web/init/src/components/config_render/ConfigTextarea.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import ConfigItemTitle from "./ConfigItemTitle";
import Markdown from "react-remarkable";

export default class ConfigTextarea extends React.Component {

Expand Down Expand Up @@ -46,7 +47,17 @@ export default class ConfigTextarea extends React.Component {
error={this.props.error}
/>
: null}
{this.props.help_text !== "" ? <p className="field-section-help-text u-marginTop--small u-lineHeight--normal">{this.props.help_text}</p> : null}
{this.props.help_text !== "" ?
<p className="field-section-help-text u-marginTop--small u-lineHeight--normal u-marginLeft--small">
<Markdown
options={{
linkTarget: "_blank",
linkify: true,
}}>
{this.props.help_text}
</Markdown>
</p>
: null}
<div className="field-input-wrapper u-marginTop--15">
<textarea
ref={this.textareaRef}
Expand Down

0 comments on commit 5acc8ad

Please sign in to comment.