Skip to content
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

Fix fonts for orchid shades and correct typography step issues #407

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/OnboardingSPA/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
allSteps: select( nfdOnboardingStore ).getAllSteps(),
};
},
[ location.pathname ]

Check warning on line 74 in src/OnboardingSPA/components/App/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useSelect has an unnecessary dependency: 'location.pathname'. Either exclude it or remove the dependency array

Check warning on line 74 in src/OnboardingSPA/components/App/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useSelect has an unnecessary dependency: 'location.pathname'. Either exclude it or remove the dependency array
);

const [ isRequestPlaced, setIsRequestPlaced ] = useState( false );
Expand Down Expand Up @@ -158,7 +158,7 @@
function handleConditionalDesignStepsRoutes() {
if (
location?.pathname.includes( 'colors' ) ||
location?.pathname.includes( 'fonts' )
location?.pathname.includes( 'typography' )
) {
const updates = injectInAllSteps(
allSteps,
Expand Down Expand Up @@ -303,7 +303,7 @@
setActiveFlow( onboardingFlow );
setActiveStep( location.pathname );
}
}, [ location.pathname, onboardingFlow ] );

Check warning on line 306 in src/OnboardingSPA/components/App/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'handleConditionalDesignStepsRoutes', 'handlePreviousStepTracking', 'setActiveFlow', 'setActiveStep', and 'syncStoreToDB'. Either include them or remove the dependency array

Check warning on line 306 in src/OnboardingSPA/components/App/index.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'handleConditionalDesignStepsRoutes', 'handlePreviousStepTracking', 'setActiveFlow', 'setActiveStep', and 'syncStoreToDB'. Either include them or remove the dependency array

return (
<Fragment>
Expand Down
16 changes: 8 additions & 8 deletions src/OnboardingSPA/components/Drawer/DrawerPanel/DesignFonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@
setSelectedFont( currentData?.data?.fontStyle );
handleClick( currentData?.data?.fontStyle );
}
}, [ fontPalettes, storedPreviewSettings ] );

Check warning on line 68 in src/OnboardingSPA/components/Drawer/DrawerPanel/DesignFonts.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'currentData?.data?.fontStyle' and 'handleClick'. Either include them or remove the dependency array

Check warning on line 68 in src/OnboardingSPA/components/Drawer/DrawerPanel/DesignFonts.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has missing dependencies: 'currentData?.data?.fontStyle' and 'handleClick'. Either include them or remove the dependency array

useEffect( () => {
if ( ! isLoaded && THEME_STATUS_ACTIVE === themeStatus ) {
getFontStylesAndPatterns();
}
}, [ isLoaded, themeStatus ] );

Check warning on line 74 in src/OnboardingSPA/components/Drawer/DrawerPanel/DesignFonts.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'getFontStylesAndPatterns'. Either include it or remove the dependency array

Check warning on line 74 in src/OnboardingSPA/components/Drawer/DrawerPanel/DesignFonts.js

View workflow job for this annotation

GitHub Actions / Run Lint Checks

React Hook useEffect has a missing dependency: 'getFontStylesAndPatterns'. Either include it or remove the dependency array

const handleClick = async ( fontStyle, context = 'click' ) => {
if ( selectedFont === fontStyle ) {
Expand All @@ -85,17 +85,17 @@

if (
globalStylesCopy?.styles?.typography?.fontFamily &&
globalStylesCopy?.styles?.blocks[ 'core/heading' ]?.typography
?.fontFamily
globalStylesCopy?.styles?.blocks[ 'core/heading' ]
) {
globalStylesCopy.styles.typography.fontFamily =
fontPalettesCopy[ fontStyle ]?.styles?.typography?.fontFamily;
globalStylesCopy.styles.blocks[
'core/heading'
].typography.fontFamily =
fontPalettesCopy[ fontStyle ]?.styles.blocks[
'core/heading'
].typography.fontFamily;
globalStylesCopy.styles.blocks[ 'core/heading' ] = {
...globalStylesCopy.styles.blocks[ 'core/heading' ],
typography:
fontPalettesCopy[ fontStyle ]?.styles.blocks[
'core/heading'
].typography,
};
}

if (
Expand Down