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
Create @woocommerce/admin-layout package #37094
Conversation
6d56947
to
a456e75
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #37094 +/- ##
========================================
Coverage 46.7% 46.7%
- Complexity 17188 17190 +2
========================================
Files 429 429
Lines 64821 64834 +13
========================================
+ Hits 30251 30275 +24
+ Misses 34570 34559 -11
|
Test Results SummaryCommit SHA: 3843cc2
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
packages/js/admin-layout/.npmrc
Outdated
@@ -0,0 +1 @@ | |||
pacakge-lock=false |
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.
Typo here!
@@ -27,7 +29,10 @@ export const WC_FOOTER_SLOT_NAME = 'woocommerce_footer_item'; | |||
* @param {Array} param0.children - Node children. | |||
* @param {Array} param0.order - Node order. | |||
*/ | |||
export const WooFooterItem: React.FC< { order?: number } > & { | |||
export const WooFooterItem: React.FC< { | |||
children?: React.ReactNode; |
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.
Why did children
was added here?
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 React 18, the children
prop is no longer implicitly on FC
. So, you have to explicitly define it.
I couldn't find any issues with smoke tests! All good. Please ping me again when you fix the conflicts and I'll re-review 😄 |
3e0ae75
to
acd5ca8
Compare
@nathanss Ready for re-review, though be aware that we may go with |
…onents for WooFooterItem
…o @woocommerce/admin-layout
d1a547f
to
fc1dfee
Compare
Output of
However, running I'm not sure what's going on! |
Hey @mattsherman, it might not be this but the long regex in Docs on |
@JamieMason Thanks for the tip using @samueljseay That said, given that we have |
All Submissions:
Changes proposed in this Pull Request:
This adds a new package:
@woocommerce/admin-layout
with the following initial components moved over fromwoocommerce/client/admin
:WooHeaderItem
WooHeaderNavigationItem
WooHeaderPageTitle
WooFooterItem
More admin layout-specific components will be moved over in the future.
Closes #36721.
How to test the changes in this Pull Request:
Load this branch and run
pnpm install && pnpm run build
and make sure everything builds correctly.Smoke test WCAdmin pages and make sure that the headers and footers appears correctly.
Open your console and check if
window.wc.adminLayout
exists with the following components:WC_FOOTER_SLOT_NAME
WC_HEADER_NAVIGATION_SLOT_NAME
WC_HEADER_PAGE_TITLE_SLOT_NAME
WC_HEADER_SLOT_NAME
WooFooterItem
WooHeaderItem
WooHeaderNavigationItem
WooHeaderPageTitle
Other information:
pnpm --filter=<project> changelog add
?FOR PR REVIEWER ONLY: