@@ -77,6 +77,7 @@ export default function useLayoutAreas() {
77
77
const isSiteEditorLoading = useIsSiteEditorLoading ( ) ;
78
78
const { params } = useLocation ( ) ;
79
79
const { postType, postId, path, layout, isCustom, canvas } = params ;
80
+ const hasEditCanvasMode = canvas === 'edit' ;
80
81
useRedirectOldPaths ( ) ;
81
82
82
83
// Page list
@@ -93,15 +94,14 @@ export default function useLayoutAreas() {
93
94
/>
94
95
) ,
95
96
content : < PagePages /> ,
96
- preview : ( isListLayout || canvas === 'edit' ) && (
97
+ preview : ( isListLayout || hasEditCanvasMode ) && (
97
98
< Editor isLoading = { isSiteEditorLoading } />
98
99
) ,
99
- mobile :
100
- canvas === 'edit' ? (
101
- < Editor isLoading = { isSiteEditorLoading } />
102
- ) : (
103
- < PagePages />
104
- ) ,
100
+ mobile : hasEditCanvasMode ? (
101
+ < Editor isLoading = { isSiteEditorLoading } />
102
+ ) : (
103
+ < PagePages />
104
+ ) ,
105
105
} ,
106
106
widths : {
107
107
content : isListLayout ? 380 : undefined ,
@@ -119,10 +119,14 @@ export default function useLayoutAreas() {
119
119
< SidebarNavigationScreenTemplatesBrowse backPath = { { } } />
120
120
) ,
121
121
content : < PageTemplates /> ,
122
- preview : ( isListLayout || canvas === 'edit' ) && (
122
+ preview : ( isListLayout || hasEditCanvasMode ) && (
123
123
< Editor isLoading = { isSiteEditorLoading } />
124
124
) ,
125
- mobile : < PageTemplates /> ,
125
+ mobile : hasEditCanvasMode ? (
126
+ < Editor isLoading = { isSiteEditorLoading } />
127
+ ) : (
128
+ < PageTemplates />
129
+ ) ,
126
130
} ,
127
131
widths : {
128
132
content : isListLayout ? 380 : undefined ,
@@ -139,8 +143,12 @@ export default function useLayoutAreas() {
139
143
areas : {
140
144
sidebar : < SidebarNavigationScreenPatterns backPath = { { } } /> ,
141
145
content : < PagePatterns /> ,
142
- mobile : < PagePatterns /> ,
143
- preview : canvas === 'edit' && (
146
+ mobile : hasEditCanvasMode ? (
147
+ < Editor isLoading = { isSiteEditorLoading } />
148
+ ) : (
149
+ < PagePatterns />
150
+ ) ,
151
+ preview : hasEditCanvasMode && (
144
152
< Editor isLoading = { isSiteEditorLoading } />
145
153
) ,
146
154
} ,
@@ -156,7 +164,7 @@ export default function useLayoutAreas() {
156
164
< SidebarNavigationScreenGlobalStyles backPath = { { } } />
157
165
) ,
158
166
preview : < Editor isLoading = { isSiteEditorLoading } /> ,
159
- mobile : canvas === 'edit' && (
167
+ mobile : hasEditCanvasMode && (
160
168
< Editor isLoading = { isSiteEditorLoading } />
161
169
) ,
162
170
} ,
@@ -175,7 +183,7 @@ export default function useLayoutAreas() {
175
183
/>
176
184
) ,
177
185
preview : < Editor isLoading = { isSiteEditorLoading } /> ,
178
- mobile : canvas === 'edit' && (
186
+ mobile : hasEditCanvasMode && (
179
187
< Editor isLoading = { isSiteEditorLoading } />
180
188
) ,
181
189
} ,
@@ -188,7 +196,7 @@ export default function useLayoutAreas() {
188
196
< SidebarNavigationScreenNavigationMenus backPath = { { } } />
189
197
) ,
190
198
preview : < Editor isLoading = { isSiteEditorLoading } /> ,
191
- mobile : canvas === 'edit' && (
199
+ mobile : hasEditCanvasMode && (
192
200
< Editor isLoading = { isSiteEditorLoading } />
193
201
) ,
194
202
} ,
@@ -201,7 +209,7 @@ export default function useLayoutAreas() {
201
209
areas : {
202
210
sidebar : < SidebarNavigationScreenMain /> ,
203
211
preview : < Editor isLoading = { isSiteEditorLoading } /> ,
204
- mobile : canvas === 'edit' && (
212
+ mobile : hasEditCanvasMode && (
205
213
< Editor isLoading = { isSiteEditorLoading } />
206
214
) ,
207
215
} ,
0 commit comments