Skip to content

Conversation

@sophschneider
Copy link
Contributor

@sophschneider sophschneider commented Aug 10, 2023

WHY are these changes introduced?

Fixes #9919

WHAT is this pull request doing?

  • Removes se23 conditional logic for Banner.tsx
  • Consolidates se23 conditional styles for Banner.scss
  • Removes unused styles
  • Merges BannerExperimental with main Banner

How to 🎩

Compare production and this PR's chromatic storybook to make sure styles are the same

Production
This PR

@sophschneider sophschneider changed the base branch from main to next August 10, 2023 16:32
@sophschneider sophschneider force-pushed the sophie/banner-cleanup branch 3 times, most recently from c3b7e2d to a6a4f99 Compare August 15, 2023 14:46
@sophschneider sophschneider marked this pull request as ready for review August 15, 2023 14:56
@sophschneider sophschneider force-pushed the sophie/banner-cleanup branch from a6a4f99 to 56a39aa Compare August 15, 2023 16:21
icon: InfoMinor,
},
};

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this utility over from the old Banner.tsx file (it used to be at the end of it)

WithinContentContainerBanner,
} from '../components/BannerExperimental/BannerExperimental';

describe('<Banner />', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were the tests for the old Banner, the tests for the new one are in a different describe block below

@@ -1 +1,2 @@
export * from './Banner';
export type {BannerHandles} from './utilities';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was previously part of the * export in Banner, but since I moved it to utilities, I have to export it separately

</BannerContext.Provider>
);
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The code below was moved from BannerExperimental

props: BannerProps,
bannerRef,
) {
const {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed all old unused tsx from the old Banner

right: var(--p-space-4);
top: var(--p-space-5);
position: absolute;
margin-top: var(--p-space-4);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should have been --p-space-4 (its the spacing between multiple banners)

@@ -1,50 +1,9 @@
@import '../../styles/common';

@mixin banner-variants($in-page) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not using this mixin anymore as it just made the file confusing. I put the appropriate styles in the withinPage and withinContentContainer classes since thats the only place this mixin was being called. Shared styles went to .Banner. .Banner, .withinPage, and .withinContentContainer are all only applied to the same wrapping div

outline: var(--p-border-width-2) solid
var(--p-color-border-interactive-focus);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None of these status class names are applied when the flag is true

display: flex;

// stylelint-disable selector-max-class, selector-max-specificity -- generated by polaris-migrator DO NOT COPY
&.statusCritical .PrimaryAction.Button {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

None of these classnames are applied when the flag is true

padding: 0;
}

.Dismiss {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

.Dismiss isn't being applied when the flag is true

@sophschneider sophschneider force-pushed the sophie/banner-cleanup branch from 56a39aa to 0ee47ff Compare August 15, 2023 18:51
@sam-b-rose sam-b-rose force-pushed the next branch 4 times, most recently from 5d459f8 to 700a72f Compare August 15, 2023 23:10
@sam-b-rose sam-b-rose force-pushed the sophie/banner-cleanup branch from 0ee47ff to 8ac1c54 Compare August 16, 2023 16:45
Copy link
Member

@sam-b-rose sam-b-rose left a comment

Choose a reason for hiding this comment

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

Legendary clean up 🧹 ✨ looks good

@sophschneider sophschneider merged commit ef37f07 into next Aug 16, 2023
@sophschneider sophschneider deleted the sophie/banner-cleanup branch August 16, 2023 19:59
kyledurand pushed a commit that referenced this pull request Aug 17, 2023
### WHY are these changes introduced?

Fixes #9919

### WHAT is this pull request doing?

* Removes se23 conditional logic for `Banner.tsx`
* Consolidates se23 conditional styles for `Banner.scss`
* Removes unused styles
* Merges `BannerExperimental` with main Banner

### How to 🎩
Compare production and this PR's chromatic storybook to make sure styles
are the same


[Production](https://storybook.polaris.shopify.com/?path=/story/all-components-banner--all&globals=polarisSummerEditions2023:true)
[This
PR](https://5d559397bae39100201eedc1-cwkvegwhxb.chromatic.com/?path=/story/all-components-banner--all)
sophschneider added a commit that referenced this pull request Sep 19, 2023
### WHY are these changes introduced?

Fixes #9919

### WHAT is this pull request doing?

* Removes se23 conditional logic for `Banner.tsx`
* Consolidates se23 conditional styles for `Banner.scss`
* Removes unused styles
* Merges `BannerExperimental` with main Banner

### How to 🎩
Compare production and this PR's chromatic storybook to make sure styles
are the same


[Production](https://storybook.polaris.shopify.com/?path=/story/all-components-banner--all&globals=polarisSummerEditions2023:true)
[This
PR](https://5d559397bae39100201eedc1-cwkvegwhxb.chromatic.com/?path=/story/all-components-banner--all)
AnnaCheba pushed a commit to AnnaCheba/polaris that referenced this pull request Apr 22, 2024
### WHY are these changes introduced?

Fixes Shopify#9919

### WHAT is this pull request doing?

* Removes se23 conditional logic for `Banner.tsx`
* Consolidates se23 conditional styles for `Banner.scss`
* Removes unused styles
* Merges `BannerExperimental` with main Banner

### How to 🎩
Compare production and this PR's chromatic storybook to make sure styles
are the same


[Production](https://storybook.polaris.shopify.com/?path=/story/all-components-banner--all&globals=polarisSummerEditions2023:true)
[This
PR](https://5d559397bae39100201eedc1-cwkvegwhxb.chromatic.com/?path=/story/all-components-banner--all)
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.

[Banner] Consolidate se23 logic and styles

2 participants