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

[v3] Add Convenience Components #1183

Merged
merged 4 commits into from
May 10, 2023
Merged

[v3] Add Convenience Components #1183

merged 4 commits into from
May 10, 2023

Conversation

bendvc
Copy link
Collaborator

@bendvc bendvc commented May 9, 2023

Description

Gus ticket

This PR adds 2 (two) convenience components to the retail-react-app in order to allow those wanting to extend their template using the new extension model. This PR is first of many changes or additions of convenience components that will make extending the template easier. What these components do it allow partner developers to customize the application in a more granular way without having to override large chunks of the base template.

The convenience components added in the PR are as follows:

  1. app/components/_app/paritals/above-header.jsx: This component allows partners to add content app-wide above the navigation.
  2. app/pages/product-list/partials/above-page-header.jsx: This components allows partners to add content above the plp page.

Changes

  • Add new convenience components and updated the components they are used in.

How to Test-Drive This PR

Because by default these component don't have an implementation, follow these steps before to make them visible.

  1. Do a global search for the following text Header = () => null and replace it with this:
Header = () => (
    <div style={{border: '1px solid black', backgroundColor: 'red'}}>Custom Content</div>
)
import React from 'react'
  1. In the "template-retail-react-app" run npm start
  2. In the browser that was opened navigate to the following url http://localhost:3000/global/en-GB/category/womens
  3. You should see the below screen capture which highlights the placement of these convenience components bay making them visible. Once template extensibility is merged we can now override those components with new implementations as see them on the app/plp.
image

Checklists

General

  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

@bendvc bendvc requested a review from a team as a code owner May 9, 2023 22:14
Copy link
Collaborator

@bfeister bfeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, there's only one that stood out and is not included here – namely something along the lines of belowNavbar or something because I think that's a common spot for a site wide banner that is context aware or something

Let's disregard this suggestion, touched base with Nathan and I don't want to interfere in terms of "what's on the menu" for Template Hooks, I'm good for now

@bfeister bfeister self-requested a review May 9, 2023 22:41
</HideOnMobile>
</Header>
<>
<AboveHeader />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to have <AboveHeader /> show for checkout, better move it up and out from the condition !isCheckout ? ...

@bfeister bfeister enabled auto-merge (squash) May 10, 2023 20:11
@bfeister bfeister merged commit 2422e07 into v3 May 10, 2023
bfeister added a commit that referenced this pull request May 10, 2023
* v3:
  [v3] Add Convenience Components (#1183)
  Update commerce-sdk-react README (#1176)
  Fix missing commerce-sdk-react logout call (#1180)

# Conflicts:
#	packages/template-retail-react-app/app/components/_app/index.jsx
#	packages/template-retail-react-app/app/pages/product-list/index.jsx
bfeister added a commit that referenced this pull request May 23, 2023
* develop: (37 commits)
  [Phased Launch] Call Session bridge after login (#1220)
  [v3] Add multi-site suffix to auth token keys (#1208)
  Footer: fix hydration error with the locale dropdown (#1210)
  remove unused peerDependency @chakra-ui/system (#1212)
  @W-12582733: Expose env vars endpoint for E2E smoke tests (#1207)
  Upgrade to React 18 (#1166)
  Remove v3 branch name related actions (#1206)
  add test to reach test coverage threshold
  remove commerce-api folder
  Feature: Extract einstein RefArch-specific values to constant (#1200)
  Bump version number to 2.7.1 and update changelogs (#1197)
  store usid in cookies (#1193)
  make sure static files are copied on dev environment (#1196)
  [WIP] PWA Kit 2.7.1 release (#1181)
  [V2] Internal lib build typescript dev dependency (#1194)
  [V2] Re-generate lock files and fix hook lib tests (#1186)
  [v3] Add Convenience Components (#1183)
  Update commerce-sdk-react README (#1176)
  Add additional properties to ShopperLogin test types (#1185)
  Fix missing commerce-sdk-react logout call (#1180)
  ...

# Conflicts:
#	package-lock.json
#	packages/commerce-sdk-react/CHANGELOG.md
#	packages/commerce-sdk-react/package-lock.json
#	packages/internal-lib-build/package-lock.json
#	packages/pwa-kit-create-app/package-lock.json
#	packages/pwa-kit-dev/package-lock.json
#	packages/pwa-kit-react-sdk/package-lock.json
#	packages/pwa-kit-runtime/package-lock.json
#	packages/template-mrt-reference-app/package-lock.json
#	packages/template-retail-react-app/package-lock.json
#	packages/template-typescript-minimal/package-lock.json
#	packages/test-commerce-sdk-react/package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants