Skip to content

Commit 77057d5

Browse files
authored
[SkeletonPage] Fix title / actions layout (#7442)
### WHY are these changes introduced? I needed to fix this to take a nice screenshot for the styleguide Fixes #5241 ### WHAT is this pull request doing? Before | After ---|--- ![localhost_6006_iframe html_args= id=all-components-skeletonpage--with-dynamic-content viewMode=story(iPhone SE) (1)](https://user-images.githubusercontent.com/6844391/196540726-8aad7281-2582-4b6e-83aa-f3ced0e314ae.png) | ![localhost_6006_iframe html_args= id=all-components-skeletonpage--with-dynamic-content viewMode=story(iPhone SE)](https://user-images.githubusercontent.com/6844391/196540787-7ea0d74f-1a8c-419f-b520-a2dd1855989b.png) ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#local-development) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) <!-- Give as much information as needed to experiment with the component in the playground. --> <details> <summary>Copy-paste this code in <code>playground/Playground.tsx</code>:</summary> ```jsx import React from 'react'; import { Card, Layout, Page, SkeletonBodyText, SkeletonDisplayText, SkeletonPage, TextContainer, } from '../src'; export function Playground() { return ( <> <Page title="Orders" primaryAction={{content: 'New order'}} /> <WithDynamicContent /> <WithStaticContent /> </> ); } export function WithDynamicContent() { return ( <SkeletonPage primaryAction> <Layout> <Layout.Section> <Card sectioned> <SkeletonBodyText /> </Card> <Card sectioned> <TextContainer> <SkeletonDisplayText size="small" /> <SkeletonBodyText /> </TextContainer> </Card> <Card sectioned> <TextContainer> <SkeletonDisplayText size="small" /> <SkeletonBodyText /> </TextContainer> </Card> </Layout.Section> <Layout.Section secondary> <Card> <Card.Section> <TextContainer> <SkeletonDisplayText size="small" /> <SkeletonBodyText lines={2} /> </TextContainer> </Card.Section> <Card.Section> <SkeletonBodyText lines={1} /> </Card.Section> </Card> <Card subdued> <Card.Section> <TextContainer> <SkeletonDisplayText size="small" /> <SkeletonBodyText lines={2} /> </TextContainer> </Card.Section> <Card.Section> <SkeletonBodyText lines={2} /> </Card.Section> </Card> </Layout.Section> </Layout> </SkeletonPage> ); } export function WithStaticContent() { return ( <SkeletonPage title="Products" primaryAction> <Layout> <Layout.Section> <Card sectioned> <SkeletonBodyText /> </Card> <Card sectioned title="Images"> <SkeletonBodyText /> </Card> <Card sectioned title="Variants"> <SkeletonBodyText /> </Card> </Layout.Section> <Layout.Section secondary> <Card title="Sales channels"> <Card.Section> <SkeletonBodyText lines={2} /> </Card.Section> <Card.Section> <SkeletonBodyText lines={1} /> </Card.Section> </Card> <Card title="Organization" subdued> <Card.Section> <SkeletonBodyText lines={2} /> </Card.Section> <Card.Section> <SkeletonBodyText lines={2} /> </Card.Section> </Card> </Layout.Section> </Layout> </SkeletonPage> ); } ``` </details> ### 🎩 checklist - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 8fb2158 commit 77057d5

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

.changeset/weak-readers-notice.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': patch
3+
---
4+
5+
Fix SkeletonPage actions layout

polaris-react/src/components/SkeletonPage/SkeletonPage.scss

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ $skeleton-display-text-max-width: 120px;
3434

3535
.TitleAndPrimaryAction {
3636
display: flex;
37-
38-
@media #{$p-breakpoints-lg-down} {
39-
display: block;
40-
}
37+
align-items: flex-start;
4138
}
4239

4340
.TitleWrapper {
@@ -73,20 +70,6 @@ $skeleton-display-text-max-width: 120px;
7370
height: $primary-action-button-height;
7471
min-width: $primary-action-button-width;
7572
}
76-
77-
@media #{$p-breakpoints-lg-down} {
78-
margin-top: var(--p-space-4);
79-
margin-bottom: calc(-1 * var(--p-space-2));
80-
}
81-
82-
@media #{$p-breakpoints-sm-up} {
83-
margin-top: var(--p-space-2);
84-
margin-bottom: calc(-1 * var(--p-space-2));
85-
}
86-
87-
@media #{$p-breakpoints-md-up} {
88-
margin-top: 0;
89-
}
9073
}
9174

9275
.Actions {

0 commit comments

Comments
 (0)