-
Notifications
You must be signed in to change notification settings - Fork 147
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
@W-18014214 useBlockNavigation implementation in SEO #2288
base: extensibility/seo-feature
Are you sure you want to change the base?
Conversation
* @param {function} func | ||
* @returns {boolean} State that is set to true during blocking, false otherwise. | ||
*/ | ||
export const useBlockNavigation = (func) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting to make it clearer what's been added: this hook will be added to pwa-kit-react-sdk
@@ -20,13 +20,16 @@ | |||
}, | |||
"devDependencies": { | |||
"@chakra-ui/react": "^2.8.2", | |||
"@chakra-ui/skip-nav": "^2.0.15", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In spite of deleting node_modules and package-lock.json in this package and extension-chakra-storefront
and doing npm install
, the error:
Module not found: Error: Can't resolve '@chakra-ui/skip-nav' in '/Users/jangho.jung/Documents/pwa-kit/packages/extension-chakra-storefront/src/components/with-layout'
kept showing up. Adding the package in here temporarily fixed it. Will need to see what's causing this issue
} from '@salesforce/pwa-kit-extension-sdk/react' | ||
type SeoHOCProps = React.ComponentPropsWithoutRef<any> | ||
|
||
const seoHOC = <P extends object>(WrappedComponent: React.ComponentType<P>) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting to make it clear what's been added:
an seo HOC that has the callback function that will soon hold the getUrlMapping API call. Currently it is a timeout.
*/ | ||
export type Config = Required<UserConfig> | ||
|
||
interface StoreSlice { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting to make it clear what's been added:
An extension store for isBlocked and its state updater so that it can be accessed from the storefront extension
Lint and add ignore file
W-18014214
Description
This is the implementation of the useBlockNavigation function in pwa-kit-react-sdk and its example usage with a temporary callback that executes a timeout. In W-17530042 this callback will be replaced with logic that calls the getUrlMapping API and updates the routes.
A change is also made in
extension-chakra-storefront
that adds a loading screen between the header and the footer while the navigation is blocked.Types of Changes
Changes
extension-chakra-storefront
pwa-kit-react-sdk
How to Test-Drive This PR
Testing that the navigation is being blocked with a loading screen and that the latest clicked link is activated
Testing that when
extension-seo-url-mapping
is disabled, the navigation works like it used toChecklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization