-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #588 from mmrtnz/master
v0.8.0 Prerelease
- Loading branch information
Showing
240 changed files
with
9,029 additions
and
7,126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
var React = require('react'), | ||
hljs = require('highlight.js'); | ||
|
||
var CodeBlock = React.createClass({ | ||
class CodeBlock extends React.Component { | ||
|
||
componentDidMount: function() { | ||
constructor() { | ||
super(); | ||
this.componentDidMount = this.componentDidMount.bind(this); | ||
this.componentDidUpdate = this.componentDidUpdate.bind(this); | ||
} | ||
|
||
componentDidMount() { | ||
hljs.highlightBlock(React.findDOMNode(this)); | ||
}, | ||
} | ||
|
||
componentDidUpdate: function(prevProps, prevState) { | ||
componentDidUpdate(prevProps, prevState) { | ||
hljs.highlightBlock(React.findDOMNode(this)); | ||
}, | ||
} | ||
|
||
render: function() { | ||
render() { | ||
return ( | ||
<pre className="code-block"> | ||
<code>{this.props.children}</code> | ||
</pre> | ||
); | ||
} | ||
|
||
}); | ||
} | ||
|
||
module.exports = CodeBlock; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,39 @@ | ||
var React = require('react'), | ||
mui = require('mui'), | ||
Paper = mui.Paper, | ||
CodeBlock = require('./code-block.jsx'); | ||
|
||
var CodeExample = React.createClass({ | ||
class CodeExample extends React.Component { | ||
|
||
propTypes: { | ||
code: React.PropTypes.string.isRequired | ||
}, | ||
render() { | ||
var borderColor = this.context.theme.palette.borderColor; | ||
var style = { | ||
label: { | ||
color: borderColor | ||
}, | ||
block: { | ||
borderRadius: '0 0 2px 0' | ||
} | ||
}; | ||
|
||
render: function() { | ||
return ( | ||
<mui.Paper className="code-example"> | ||
<div className="example-label">example</div> | ||
<div className="example-block"> | ||
<div className="example-label" style={style.label}>example</div> | ||
<div className="example-block" style={style.block}> | ||
{this.props.children} | ||
</div> | ||
<CodeBlock>{this.props.code}</CodeBlock> | ||
</mui.Paper> | ||
); | ||
} | ||
} | ||
|
||
}); | ||
CodeExample.propTypes = { | ||
code: React.PropTypes.string.isRequired | ||
}; | ||
|
||
module.exports = CodeExample; | ||
CodeExample.contextTypes = { | ||
theme: React.PropTypes.object | ||
} | ||
|
||
module.exports = CodeExample; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.