Skip to content

Commit

Permalink
update props
Browse files Browse the repository at this point in the history
  • Loading branch information
SokichiFujita committed Mar 21, 2018
1 parent 8c65144 commit ee92397
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 13 deletions.
29 changes: 20 additions & 9 deletions src/components/editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ class Editor extends Component {

static propTypes = {
className: PropTypes.string,
codeText: PropTypes.string,
external: PropTypes.bool,
onChange: PropTypes.func,
codeText: PropTypes.string,
theme: PropTypes.string,
lineNumbers: PropTypes.bool,
smartIndent: PropTypes.bool,
lineWrapping: PropTypes.bool,
tabSize: PropTypes.number,
readOnly: PropTypes.bool,
onChange: PropTypes.func,
selectedLines: PropTypes.array,
style: PropTypes.object,
theme: PropTypes.string
style: PropTypes.object
};

componentDidMount = () => {
Expand All @@ -42,18 +46,25 @@ class Editor extends Component {
const {
className,
external,
style,
codeText,
theme,
readOnly
lineNumbers,
smartIndent,
lineWrapping,
onChange,
tabSize,
readOnly,
selectedLines,
style,
} = this.props;

const options = {
mode: "jsx",
lineNumbers: false,
lineWrapping: true,
smartIndent: false,
matchBrackets: true,
lineWrapping,
smartIndent,
lineNumbers,
tabSize,
theme,
readOnly
};
Expand Down
23 changes: 19 additions & 4 deletions src/components/playground.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ class ReactPlayground extends Component {
noRender: true,
context: {},
initiallyExpanded: false,
onChange: () => {}
onChange: () => {},
lineNumbers: false,
lineWrapping: true,
smartIndent: false,
tabSize: 4,
};

static propTypes = {
Expand All @@ -30,7 +34,11 @@ class ReactPlayground extends Component {
context: PropTypes.object,
initiallyExpanded: PropTypes.bool,
previewComponent: PropTypes.node,
onChange: PropTypes.func
onChange: PropTypes.func,
lineNumbers: PropTypes.bool,
lineWrapping: PropTypes.bool,
smartIndent: PropTypes.bool,
tabSize: PropTypes.number
};

state = {
Expand Down Expand Up @@ -73,6 +81,10 @@ class ReactPlayground extends Component {
propDescriptionMap,
scope,
selectedLines,
lineNumbers,
lineWrapping,
smartIndent,
tabSize,
theme } = this.props;

return (
Expand All @@ -91,8 +103,11 @@ class ReactPlayground extends Component {
external={external}
onChange={this._handleCodeChange}
selectedLines={selectedLines}
theme={theme}
/>
lineNumbers={lineNumbers}
lineWrapping={lineWrapping}
smartIndent={smartIndent}
tabSize={tabSize}
theme={theme} />
</div>
{
collapsableCode ?
Expand Down

0 comments on commit ee92397

Please sign in to comment.