Skip to content

Commit

Permalink
Separate out header, content and footer for homepages
Browse files Browse the repository at this point in the history
  • Loading branch information
arunshenoy99 committed Jan 30, 2024
1 parent 8cb0d9a commit eec8d29
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 18 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,12 @@ const SitegenEditorPatternsSidebar = () => {
);
newPreviewSettings.settings.color.palette =
data.color.palette;
let blockGrammar = '';
[ 'header', 'content', 'footer' ].forEach( ( part ) => {

Check failure on line 216 in src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

Replace `·'header',·'content',·'footer'·` with `⏎↹↹↹↹↹↹↹↹↹↹↹↹↹↹'header',⏎↹↹↹↹↹↹↹↹↹↹↹↹↹↹'content',⏎↹↹↹↹↹↹↹↹↹↹↹↹↹↹'footer',⏎↹↹↹↹↹↹↹↹↹↹↹↹↹`

Check failure on line 216 in src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

Replace `·'header',·'content',·'footer'·` with `⏎↹↹↹↹↹↹↹↹↹↹↹↹↹↹'header',⏎↹↹↹↹↹↹↹↹↹↹↹↹↹↹'content',⏎↹↹↹↹↹↹↹↹↹↹↹↹↹↹'footer',⏎↹↹↹↹↹↹↹↹↹↹↹↹↹`
if ( part in data ) {
blockGrammar += data[ part ];

Check failure on line 218 in src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

Replace `·` with `⏎↹↹↹↹↹↹↹↹↹↹↹↹↹↹↹↹`

Check failure on line 218 in src/OnboardingSPA/components/Sidebar/components/SitegenEditorPatterns/Sidebar.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

Replace `·` with `⏎↹↹↹↹↹↹↹↹↹↹↹↹↹↹↹↹`
}
} );
return (
<div
className={ `nfd-onboarding-sidebar--sitegen-editor-patterns__header__tab-panel__versions-tab__preview-container` }
Expand All @@ -231,7 +243,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 eec8d29

Please sign in to comment.