|
|
@@ -1,4 +1,4 @@
|
|
|
-import React, { Fragment } from 'react';
|
|
|
+import React from 'react';
|
|
|
import PropTypes from 'prop-types';
|
|
|
import { withTranslation } from 'react-i18next';
|
|
|
|
|
|
@@ -6,70 +6,10 @@ import { createSubscribedElement } from '../../UnstatedUtils';
|
|
|
|
|
|
import AppContainer from '../../../services/AppContainer';
|
|
|
import MarkDownSettingContainer from '../../../services/MarkDownSettingContainer';
|
|
|
+import PresentationLineBreakOptions from './PresentationLineBreakOptions';
|
|
|
|
|
|
class PresentationForm extends React.Component {
|
|
|
|
|
|
- renderLineBreakOptions() {
|
|
|
- const { t, markDownSettingContainer } = this.props;
|
|
|
- const { pageBreakOption, customRegularExpression } = markDownSettingContainer.state;
|
|
|
-
|
|
|
- return (
|
|
|
- <Fragment>
|
|
|
- <div className="col-xs-3 radio radio-primary">
|
|
|
- <input
|
|
|
- type="radio"
|
|
|
- id="pageBreakOption1"
|
|
|
- checked={pageBreakOption === 1}
|
|
|
- onChange={() => { markDownSettingContainer.setState({ pageBreakOption: 1 }) }}
|
|
|
- />
|
|
|
- <label htmlFor="pageBreakOption1">
|
|
|
- <p className="font-weight-bold">{ t('markdown_setting.Preset one separator') }</p>
|
|
|
- <div className="mt-3">
|
|
|
- { t('markdown_setting.Preset one separator desc') }
|
|
|
- <pre><code>{ t('markdown_setting.Preset one separator value') }</code></pre>
|
|
|
- </div>
|
|
|
- </label>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div className="col-xs-3 radio radio-primary mt-3">
|
|
|
- <input
|
|
|
- type="radio"
|
|
|
- id="pageBreakOption2"
|
|
|
- checked={pageBreakOption === 2}
|
|
|
- onChange={() => { markDownSettingContainer.setState({ pageBreakOption: 2 }) }}
|
|
|
- />
|
|
|
- <label htmlFor="pageBreakOption2">
|
|
|
- <p className="font-weight-bold">{ t('markdown_setting.Preset two separator') }</p>
|
|
|
- <div className="mt-3">
|
|
|
- { t('markdown_setting.Preset two separator desc') }
|
|
|
- <pre><code>{ t('markdown_setting.Preset two separator value') }</code></pre>
|
|
|
- </div>
|
|
|
- </label>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div className="col-xs-3 radio radio-primary mt-3">
|
|
|
- <input
|
|
|
- type="radio"
|
|
|
- id="pageBreakOption3"
|
|
|
- checked={pageBreakOption === 3}
|
|
|
- onChange={() => { markDownSettingContainer.setState({ pageBreakOption: 3 }) }}
|
|
|
- />
|
|
|
- <label htmlFor="pageBreakOption3">
|
|
|
- <p className="font-weight-bold">{ t('markdown_setting.Custom separator') }</p>
|
|
|
- <div className="mt-3">
|
|
|
- { t('markdown_setting.Custom separator desc') }
|
|
|
- <input
|
|
|
- className="form-control"
|
|
|
- value={customRegularExpression}
|
|
|
- onChange={(e) => { markDownSettingContainer.setState({ customRegularExpression: e.target.value }) }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- </label>
|
|
|
- </div>
|
|
|
- </Fragment>
|
|
|
- );
|
|
|
- }
|
|
|
-
|
|
|
render() {
|
|
|
const { t } = this.props;
|
|
|
|
|
|
@@ -79,8 +19,7 @@ class PresentationForm extends React.Component {
|
|
|
<label className="col-xs-3 control-label text-right">
|
|
|
{ t('markdown_setting.Page break setting') }
|
|
|
</label>
|
|
|
- {/* create option as component if increase */}
|
|
|
- {this.renderLineBreakOptions()}
|
|
|
+ <PresentationLineBreakOptions />
|
|
|
<div className="form-group my-3">
|
|
|
<div className="col-xs-offset-4 col-xs-5">
|
|
|
{/* TODO GW-220 create function */}
|