@@ -21,10 +21,10 @@ import ReactDOM from 'react-dom';
2121
2222class Home extends Component {
2323 componentDidMount ( ) {
24- this . renderExamplePlaceholder ( 'helloExample' ) ;
25- this . renderExamplePlaceholder ( 'timerExample' ) ;
26- this . renderExamplePlaceholder ( 'todoExample' ) ;
27- this . renderExamplePlaceholder ( 'markdownExample' ) ;
24+ renderExamplePlaceholder ( 'helloExample' ) ;
25+ renderExamplePlaceholder ( 'timerExample' ) ;
26+ renderExamplePlaceholder ( 'todoExample' ) ;
27+ renderExamplePlaceholder ( 'markdownExample' ) ;
2828
2929 loadScript ( babelURL ) . then ( ( ) => {
3030 mountCodeExample ( 'helloExample' , HELLO_COMPONENT ) ;
@@ -34,25 +34,6 @@ class Home extends Component {
3434 } ) ;
3535 }
3636
37- renderExamplePlaceholder ( containerId ) {
38- ReactDOM . render (
39- < strong
40- css = { {
41- transform : 'translate(65%, -5em)' ,
42- display : 'block' ,
43-
44- [ media . lessThan ( 'xlarge' ) ] : {
45- transform : 'none' ,
46- marginTop : 15 ,
47- textAlign : 'center' ,
48- } ,
49- } } >
50- Loading code example...
51- </ strong > ,
52- document . getElementById ( containerId ) ,
53- ) ;
54- }
55-
5637 render ( ) {
5738 const { data} = this . props ;
5839 const title = 'React - A JavaScript library for building user interfaces' ;
@@ -192,6 +173,16 @@ Home.propTypes = {
192173 location : PropTypes . object . isRequired ,
193174} ;
194175
176+ // TODO Improve this temporarily placeholder as part of
177+ // converting the home page from markdown template to a Gatsby
178+ // page (see issue #2)
179+ function renderExamplePlaceholder ( containerId ) {
180+ ReactDOM . render (
181+ < h4 > Loading code example...</ h4 > ,
182+ document . getElementById ( containerId ) ,
183+ ) ;
184+ }
185+
195186const CtaItem = ( { children, primary = false } ) => (
196187 < div
197188 css = { {
0 commit comments