-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Themes: SSR testing branch #846
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c0f88d7
Create a ThemesLoggedOutLayout to server-render
ockham 0c4a534
React tree reconciliation
ehg 34e39f9
Various rebase fixes
ehg 447a9a3
Themes: Move logged out layout setup to controller
seear c169260
Enable themes/logged out in wpcalypso
ehg 351f69e
Use lib/local-storage polyfill
ehg f9262c8
Themes: Move logged-out layout props handling inside component
seear a0d5e3a
Themes: Remove Spinner from webpack stubs
seear a29b3af
Consolidate themes component instantiation into layout
ehg e4c4dd4
Themes: remove unused deps
seear 1991649
Themes: stub <Count /> on the server
seear 08d72af
Themes: Fix select-dropdown/style.scss filename
seear 692af2a
Themes: remove unnecessary change
seear 60d687b
Retain Wordpress logo for regular server layout
seear 58fbc9c
Whitespace tweak
seear 99e0cc3
Themes: Only use sticky search box when logged in
seear 5d9d045
Themes: set state on search
seear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
require( 'lib/local-storage' )( global ); | ||
|
||
/** | ||
* External dependencies. | ||
*/ | ||
|
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
isMobile: () => false | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const React = require( 'react' ); | ||
|
||
const EmptyComponent = React.createClass( { | ||
render: function() { | ||
return null; | ||
} | ||
} ); | ||
|
||
module.exports = EmptyComponent; |
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,63 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import React from 'react'; | ||
import partialRight from 'lodash/function/partialRight'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import Masterbar from './masterbar'; | ||
//import NoticesList from 'notices/notices-list'; | ||
//import notices from 'notices'; | ||
//import title from 'lib/screen-title'; | ||
import Main from 'components/main'; | ||
import themesComponent from 'my-sites/themes/themes-selection'; | ||
import getButtonOptions from 'my-sites/themes/theme-options'; | ||
|
||
const themesFactory = React.createFactory( themesComponent ); | ||
|
||
const ThemesLoggedOutLayout = React.createClass( { | ||
|
||
getDefaultProps() { | ||
return { | ||
section: 'themes', | ||
} | ||
}, | ||
|
||
themesProps: { | ||
getOptions: partialRight( getButtonOptions, () => {}, () => {} ), | ||
sites: false, | ||
setSelectedTheme: () => {}, | ||
togglePreview: () => {}, | ||
loggedIn: false, | ||
}, | ||
|
||
getTier() { | ||
const tier = typeof( window ) !== 'undefined' && window.location.pathname.match( /^\/design\/type\/(free|premium|all)\/?/ ); | ||
if ( tier ) { | ||
return { tier: tier[1] }; | ||
} | ||
}, | ||
|
||
render() { | ||
const sectionClass = 'wp' + ( this.props.section ? ' is-section-' + this.props.section : '' ); | ||
return ( | ||
<div className={ sectionClass }> | ||
<Masterbar /> | ||
<div id="content" className="wp-content"> | ||
<div id="primary" className="wp-primary wp-section"> | ||
<Main className="themes"> | ||
{ themesFactory( Object.assign( {}, this.themesProps, this.getTier(), this.props ) ) } | ||
</Main> | ||
</div> | ||
</div> | ||
<div id="tertiary" className="wp-overlay fade-background"> | ||
{ this.props.tertiary } | ||
</div> | ||
</div> | ||
); | ||
} | ||
} ); | ||
|
||
export default ThemesLoggedOutLayout; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
themes-logged-out
is a 'pure' render tree, we can't render into sections directly in our controllers. How do we update our routing & controllers to take this into account, and how do we make this generically usable?