-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update with fixes from generator and enable isormophic images (#32)
- Loading branch information
Showing
18 changed files
with
293 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,4 +154,4 @@ Procfile | |
config/assets.json | ||
npm-shrinkwrap.json | ||
|
||
.isomorphic-loader-config.json | ||
.isomorphic-loader-config.* |
This file was deleted.
Oops, something went wrong.
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,28 +1,91 @@ | ||
import React from "react"; | ||
import React, {PropTypes} from "react"; | ||
import {AboveTheFoldOnlyServerRender} from "above-the-fold-only-server-render"; | ||
import {connect} from "react-redux"; | ||
import smileyPng from "../images/718smiley.png"; | ||
import peaceSmileyPng from "../images/peace-smiley.png"; | ||
|
||
/* eslint-disable max-len */ | ||
|
||
export class AboveFold extends React.Component { | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<h3>Above-the-fold-only-server-render: Increase Your Performance</h3> | ||
<AboveTheFoldOnlyServerRender skip={true}> | ||
<div className="renderMessage" style={{color: "blue"}}> | ||
<p>This will skip server rendering if the 'AboveTheFoldOnlyServerRender' | ||
lines are present, or uncommented out.</p> | ||
<p>This will be rendered on the server and visible | ||
if the 'AboveTheFoldOnlyServerRender' lines are commented out.</p> | ||
<p>Try manually toggling this component to see it in action</p> | ||
<p> | ||
<a href="https://github.com/electrode-io/above-the-fold-only-server-render" | ||
target="_blank">Read more about this module and see our live demo | ||
</a> | ||
</p> | ||
</div> | ||
<div style={{ | ||
marginLeft: "auto", | ||
marginRight: "auto", | ||
width: "98%", | ||
border: "2px solid", | ||
padding: "5pt" | ||
}}> | ||
<h3>Above-the-fold-only-server-render: Increase Your Performance. Note: This demo uses CSS3.</h3> | ||
<p>This page demonstrates the <span>AboveTheFoldOnlyServerRender</span> component.</p> | ||
<p> | ||
<a href="https://github.com/electrode-io/above-the-fold-only-server-render" target="_blank"> | ||
Read more about this module and see our live demo | ||
</a> | ||
</p> | ||
</div> | ||
<div style={{ | ||
marginLeft: "auto", | ||
marginRight: "auto", | ||
marginTop: "10px", | ||
marginBottom: "10px", | ||
color: "blue", | ||
border: "2px solid", | ||
width: "98%", | ||
height: "90vh", | ||
padding: "5pt" | ||
}}> | ||
<p>This content block is here to fill up the browser view port as Above The Fold content and it always will be | ||
rendered on server side.</p> | ||
<p>To verify, use your browser's view source to see the original HTML of this page and see this being part of | ||
the SSR content</p> | ||
<p>You should see this fill up your browser screen to push content below the browser view port, which are | ||
wrapped in the <span>AboveTheFoldOnlyServerRender</span> component.</p> | ||
<img style={{ | ||
height: "30%" | ||
}} src={smileyPng}/> | ||
<p>Scroll down to see the content below</p> | ||
</div> | ||
{this.props.skip ? ( | ||
<div>In the page source you should NOT see any more HTML after this except a few empty <span>divs</span> | ||
</div>) | ||
: | ||
(<div>In the page source you should SEE the HTML for the wrapped component after this.</div>) | ||
} | ||
<AboveTheFoldOnlyServerRender skip={this.props.skip}> | ||
<div style={{ | ||
marginLeft: "auto", | ||
marginRight: "auto", | ||
marginTop: "10px", | ||
color: "red", | ||
border: "2px solid", | ||
width: "98%", | ||
height: "400px", | ||
padding: "5pt" | ||
}}> | ||
<p>This content block is wrapped inside the <span>AboveTheFoldOnlyServerRender</span> component, with the | ||
<span> skip</span> prop set to <span>{`${this.props.skip}`}</span>.</p> | ||
{this.props.skip ? | ||
<div><p>It will not be rendered on the server side, but you should see it in the browser.</p> | ||
<p>To verify, check the page source to see this not being part of the SSR content.</p></div> | ||
: | ||
<div><p>It is also rendered on the server side since skip is <span>{`${this.props.skip}`}</span></p> | ||
<p>To verify, check the page source to see this being part of the SSR content.</p></div> | ||
} | ||
<img src={peaceSmileyPng}/> | ||
</div> | ||
</AboveTheFoldOnlyServerRender> | ||
<h3>This is below the 'Above the fold closing tag'</h3> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
AboveFold.propTypes = { | ||
skip: PropTypes.bool | ||
}; | ||
|
||
export default connect((state) => { | ||
return {skip: state.skip}; | ||
})(AboveFold); |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const rootReducer = (state) => { | ||
return state || {}; | ||
}; | ||
|
||
export default rootReducer; |
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,17 +1,17 @@ | ||
import React from "react"; | ||
import { Route, IndexRoute} from "react-router"; | ||
import {Route, IndexRoute} from "react-router"; | ||
import Home from "./components/home"; | ||
import SSRCachingTemplateType from "./components/ssr-caching-template-type"; | ||
import SSRCachingSimpleType from "./components/ssr-caching-simple-type"; | ||
import { CSRF } from "./components/csrf"; | ||
import { AboveFold } from "./components/above-the-fold"; | ||
import {CSRF} from "./components/csrf"; | ||
import AboveFold from "./components/above-the-fold"; | ||
|
||
export const routes = ( | ||
<Route path="/"> | ||
<IndexRoute component={Home} /> | ||
<Route path="ssrcachingtemplatetype" component={SSRCachingTemplateType} /> | ||
<Route path="ssrcachingsimpletype" component={SSRCachingSimpleType} /> | ||
<Route path="csrf" component={CSRF} /> | ||
<Route path="above-the-fold" component={AboveFold} /> | ||
<IndexRoute component={Home}/> | ||
<Route path="ssrcachingtemplatetype" component={SSRCachingTemplateType}/> | ||
<Route path="ssrcachingsimpletype" component={SSRCachingSimpleType}/> | ||
<Route path="csrf" component={CSRF}/> | ||
<Route path="above-the-fold" component={AboveFold}/> | ||
</Route> | ||
); |
Oops, something went wrong.