Skip to content

Commit

Permalink
Merge pull request #438 from newfold-labs/fix/double-header-footer
Browse files Browse the repository at this point in the history
Separate out header, content and footer for homepages
  • Loading branch information
arunshenoy99 authored Jan 31, 2024
2 parents 1a03588 + 09b2913 commit 9978f1a
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 19 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"newfold-labs/wp-module-onboarding-data": "^0.1.0",
"newfold-labs/wp-module-patterns": "^0.1.12",
"newfold-labs/wp-module-install-checker": "^1.0",
"newfold-labs/wp-module-facebook": "1.0.0"
"newfold-labs/wp-module-facebook": "^1.0.2"
},
"require-dev": {
"wp-phpunit/wp-phpunit": "^6.2",
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ const SitegenEditorPatternsSidebar = () => {
const newPreviewSettings = cloneDeep( globalStyles[ 0 ] );
newPreviewSettings.settings.color.palette =
data.color.palette;
let blockGrammar = '';
[ 'header', 'content', 'footer' ].forEach( ( part ) => {
if ( part in data ) {
blockGrammar += data[ part ];
}
} );
return (
<div
className={ `nfd-onboarding-sidebar--sitegen-editor-patterns__header__tab-panel__versions-tab__preview-container` }
Expand All @@ -128,7 +134,7 @@ const SitegenEditorPatternsSidebar = () => {
? 'custom'
: 'custom__highlighted'
}
blockGrammer={ data.content }
blockGrammer={ blockGrammar }
viewportWidth={ 1300 }
previewSettings={ newPreviewSettings }
skeletonLoadingTime={ 0 }
Expand Down Expand Up @@ -206,6 +212,17 @@ const SitegenEditorPatternsSidebar = () => {
);
newPreviewSettings.settings.color.palette =
data.color.palette;
let blockGrammar = '';
[
'header',
'content',
'footer',
].forEach( ( part ) => {
if ( part in data ) {
blockGrammar +=
data[ part ];
}
} );
return (
<div
className={ `nfd-onboarding-sidebar--sitegen-editor-patterns__header__tab-panel__versions-tab__preview-container` }
Expand All @@ -231,7 +248,7 @@ const SitegenEditorPatternsSidebar = () => {
: 'custom__highlighted'
}
blockGrammer={
data.content
blockGrammar
}
viewportWidth={
1300
Expand Down Expand Up @@ -306,6 +323,17 @@ const SitegenEditorPatternsSidebar = () => {
);
newPreviewSettings.settings.color.palette =
data.color.palette;
let blockGrammar = '';
[
'header',
'content',
'footer',
].forEach( ( part ) => {
if ( part in data ) {
blockGrammar +=
data[ part ];
}
} );
return (
<div
key={ data.slug }
Expand All @@ -331,7 +359,7 @@ const SitegenEditorPatternsSidebar = () => {
: 'custom__highlighted'
}
blockGrammer={
data.content
blockGrammar
}
viewportWidth={
1300
Expand Down
9 changes: 8 additions & 1 deletion src/OnboardingSPA/steps/SiteGen/Editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,16 @@ const StepSiteGenEditor = () => {
populateFontsInPreviewSettings( newPreviewSettings );
}

let blockGrammar = '';
[ 'header', 'content', 'footer' ].forEach( ( part ) => {
if ( part in homepage ) {
blockGrammar += homepage[ part ];
}
} );

return (
<LivePreview
blockGrammer={ homepage.content }
blockGrammer={ blockGrammar }
styling={ 'custom' }
previewSettings={ newPreviewSettings }
viewportWidth={ 1300 }
Expand Down
8 changes: 7 additions & 1 deletion src/OnboardingSPA/steps/SiteGen/Preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,16 @@ const SiteGenPreview = () => {
const data = homepages[ slug ];
const newPreviewSettings = cloneDeep( globalStyles[ 0 ] );
newPreviewSettings.settings.color.palette = data.color.palette;
let blockGrammar = '';
[ 'header', 'content', 'footer' ].forEach( ( part ) => {
if ( part in data ) {
blockGrammar += data[ part ];
}
} );
return (
<SiteGenPreviewSelectableCard
key={ idx }
blockGrammar={ data.content }
blockGrammar={ blockGrammar }
previewSettings={ newPreviewSettings }
slug={ slug }
title={ data.title }
Expand Down

0 comments on commit 9978f1a

Please sign in to comment.