Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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