-
Notifications
You must be signed in to change notification settings - Fork 21
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
Replace FullScreen and FullContainer components with useLayout hook #1206
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8a610f3
Move full-container/index.scss to primary css folder
eason9487 b9dd0d0
Move full-screen/index.scss to primary css folder
eason9487 4689e0d
Merge branch 'tmp/311-move-files' into tweak/311-use-layout
eason9487 89cf9aa
Implement useLayout hook to apply full page/content layout
eason9487 46c90ee
Use CSS approach to override `margin-top` of #wpbody instead of useWP…
eason9487 a5e8509
Move the CSS for hidden Spinner for Suspended StoreAlert to global scope
eason9487 28a8052
Replace all FullContainer usages with useLayout
eason9487 952921a
Replace all FullScreen usages with useLayout
eason9487 843e484
Add code comments for why filter classes
eason9487 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
js/src/components/full-container/useWPBodyMarginOffsetEffect.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
/** | ||
* Workaround to hide the initial loading spinner that causes whole page flickering. | ||
* The flickering issue has been fixed and released with WC-admin 2.9.0. | ||
* - https://github.com/woocommerce/woocommerce-admin/pull/7886 | ||
* - https://github.com/woocommerce/woocommerce-admin/blob/v2.9.0/changelog.txt#L16 | ||
* | ||
* This workaround can be removed after the L-2 version ≥ WC 6.0, which uses WC-admin 2.9.4 | ||
*/ | ||
.woocommerce-layout__primary { | ||
> .woocommerce-spinner:first-child { | ||
display: none; | ||
} | ||
} | ||
|
||
// Used in .~/hooks/useLayout.js | ||
.gla-full-content { | ||
// #wpbody `margin-top` style is set onto DOM node directly in WC Admin. | ||
// Here force override it to 0. | ||
// Ref: https://github.com/woocommerce/woocommerce-admin/blob/95c487247416ab34eb8e492b984e2b068618e0d3/client/header/index.js#L92-L118. | ||
#wpbody { | ||
margin-top: 0 !important; | ||
} | ||
|
||
.woocommerce-layout { | ||
padding-top: 0; | ||
|
||
// set the layout header width to 0 to hide it. | ||
// do not set the header to display: none, | ||
// because we want the offsetHeight value | ||
// and set it to wpbody-content margin-top to counter back. | ||
.woocommerce-layout__header { | ||
width: 0; | ||
|
||
// only display the top left WC navigation, | ||
// do not display the h1 page title element | ||
// and the top right activity panel. | ||
&-wrapper > *:not(.woocommerce-navigation) { | ||
display: none; | ||
} | ||
} | ||
|
||
// Hide StoreAlerts. | ||
.woocommerce-store-alerts, | ||
.woocommerce-layout__notice-list { | ||
display: none; | ||
} | ||
.woocommerce-layout__primary { | ||
margin: 0; | ||
|
||
.woocommerce-layout__main { | ||
padding: 0; | ||
|
||
} | ||
} | ||
} | ||
|
||
// the following is only applicable when WC Navigation is enabled | ||
// and the page is on a large screen with .is-wc-nav-expanded applied. | ||
&.has-woocommerce-navigation.is-wc-nav-expanded { | ||
.woocommerce-layout__header { | ||
// WC Navigation lies inside woocommerce-layout__header, | ||
// so we need to display this. | ||
display: block; | ||
|
||
// width of the WC Navigation sidebar. | ||
width: 240px; | ||
} | ||
} | ||
} | ||
|
||
// Used in .~/hooks/useLayout.js | ||
.gla-full-page { | ||
// hack to fix the margin-top when WC Navigation is not enabled | ||
// and width is between 600px and 782px. | ||
// without this, the margin-top would be -32px, | ||
// and there would be a visible small grey gap. | ||
&.is-wp-toolbar-disabled:not(.has-woocommerce-navigation) { | ||
@media (min-width: #{ ($break-small) }) and (max-width: #{ ($break-medium) }) { | ||
margin-top: -46px; | ||
} | ||
} | ||
|
||
.woocommerce-layout { | ||
padding-top: 0; | ||
|
||
.woocommerce-layout__primary { | ||
margin: 0; | ||
|
||
.woocommerce-layout__main { | ||
padding: 0; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Most of the CSS was moved from
<FullScreen>
and<FullContainer>
and merged to a single file. It'd be easier to check the diff from this link.