@@ -24,7 +24,14 @@ import QueryPreferences from 'components/data/query-preferences';
24
24
import QuerySites from 'components/data/query-sites' ;
25
25
import QuerySiteSelectedEditor from 'components/data/query-site-selected-editor' ;
26
26
import { isOffline } from 'state/application/selectors' ;
27
- import { getSelectedSiteId , hasSidebar , masterbarIsVisible } from 'state/ui/selectors' ;
27
+ import {
28
+ getSelectedSiteId ,
29
+ hasSidebar ,
30
+ masterbarIsVisible ,
31
+ getSectionGroup ,
32
+ getSectionName ,
33
+ isSectionLoading ,
34
+ } from 'state/ui/selectors' ;
28
35
import isHappychatOpen from 'state/happychat/selectors/is-happychat-open' ;
29
36
import SitePreview from 'blocks/site-preview' ;
30
37
import SupportArticleDialog from 'blocks/support-article-dialog' ;
@@ -51,8 +58,9 @@ class Layout extends Component {
51
58
masterbarIsHidden : PropTypes . bool ,
52
59
isLoading : PropTypes . bool ,
53
60
isSupportUser : PropTypes . bool ,
54
- section : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . object ] ) ,
55
61
isOffline : PropTypes . bool ,
62
+ sectionGroup : PropTypes . string ,
63
+ sectionName : PropTypes . string ,
56
64
colorSchemePreference : PropTypes . string ,
57
65
} ;
58
66
@@ -88,8 +96,8 @@ class Layout extends Component {
88
96
render ( ) {
89
97
const sectionClass = classnames (
90
98
'layout' ,
91
- `is-group-${ this . props . section . group } ` ,
92
- `is-section-${ this . props . section . name } ` ,
99
+ `is-group-${ this . props . sectionGroup } ` ,
100
+ `is-section-${ this . props . sectionName } ` ,
93
101
`focus-${ this . props . currentLayoutFocus } ` ,
94
102
{ 'is-support-user' : this . props . isSupportUser } ,
95
103
{ 'has-no-sidebar' : ! this . props . hasSidebar } ,
@@ -112,8 +120,8 @@ class Layout extends Component {
112
120
{ config . isEnabled ( 'nps-survey/notice' ) && ! isE2ETest ( ) && < NpsSurveyNotice /> }
113
121
{ config . isEnabled ( 'keyboard-shortcuts' ) ? < KeyboardShortcutsMenu /> : null }
114
122
< MasterbarLoggedIn
115
- section = { this . props . section . group }
116
- compact = { this . props . section . name === 'checkout' }
123
+ section = { this . props . sectionGroup }
124
+ compact = { this . props . sectionName === 'checkout' }
117
125
/>
118
126
{ config . isEnabled ( 'support-user' ) && < SupportUser /> }
119
127
< div className = { loadingClass } >
@@ -125,7 +133,7 @@ class Layout extends Component {
125
133
< GlobalNotices
126
134
id = "notices"
127
135
notices = { notices . list }
128
- forcePinned = { 'post' === this . props . section . name }
136
+ forcePinned = { 'post' === this . props . sectionName }
129
137
/>
130
138
131
139
< div id = "secondary" className = "layout__secondary" role = "navigation" >
@@ -140,13 +148,13 @@ class Layout extends Component {
140
148
) : (
141
149
< TranslatorLauncher />
142
150
) }
143
- { this . props . section . group === 'sites' && < SitePreview /> }
151
+ { this . props . sectionGroup === 'sites' && < SitePreview /> }
144
152
{ config . isEnabled ( 'happychat' ) &&
145
153
this . props . chatIsOpen && < AsyncLoad require = "components/happychat" /> }
146
154
{ 'development' === process . env . NODE_ENV && (
147
155
< AsyncLoad require = "components/webpack-build-monitor" placeholder = { null } />
148
156
) }
149
- { ( 'jetpack-connect' !== this . props . section . name ||
157
+ { ( 'jetpack-connect' !== this . props . sectionName ||
150
158
this . props . currentRoute === '/jetpack/new' ) &&
151
159
this . props . currentRoute !== '/log-in/jetpack' && (
152
160
< AsyncLoad require = "blocks/inline-help" placeholder = { null } />
@@ -160,12 +168,14 @@ class Layout extends Component {
160
168
}
161
169
162
170
export default connect ( state => {
163
- const { isLoading, section } = state . ui ;
171
+ const sectionGroup = getSectionGroup ( state ) ;
172
+ const sectionName = getSectionName ( state ) ;
164
173
return {
165
- masterbarIsHidden : ! masterbarIsVisible ( state ) ,
166
- isLoading,
174
+ masterbarIsHidden : ! masterbarIsVisible ( state ) || 'signup' === sectionName ,
175
+ isLoading : isSectionLoading ( state ) ,
167
176
isSupportUser : state . support . isSupportUser ,
168
- section,
177
+ sectionGroup,
178
+ sectionName,
169
179
hasSidebar : hasSidebar ( state ) ,
170
180
isOffline : isOffline ( state ) ,
171
181
currentLayoutFocus : getCurrentLayoutFocus ( state ) ,
0 commit comments