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

Update Banner mobile styles #11959

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update icon color logic
Co-authored-by: Aveline Thelen <[email protected]>
lgriffee and aveline committed May 8, 2024
commit a87d4e1b7fb20ad006a155ef810b4c2f46ca959a
26 changes: 15 additions & 11 deletions polaris-react/src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
@@ -119,6 +119,20 @@ export function BannerLayout({
withinContentContainer ? 'withinContentContainer' : 'withinPage'
];

let iconClassName = '';

if (smUp) {
if (isInlineIconBanner) {
iconClassName = 'icon-secondary';
} else {
iconClassName = bannerColors.icon;
}
} else if (withinContentContainer) {
iconClassName = bannerColors.icon;
} else {
iconClassName = 'icon-secondary';
}

const sharedBannerProps: BannerLayoutProps = {
backgroundColor: bannerColors.background,
textColor: bannerColors.text,
@@ -151,17 +165,7 @@ export function BannerLayout({
<Button
variant="tertiary"
icon={
<span
className={
styles[
isInlineIconBanner
? 'icon-secondary'
: smUp
? bannerColors.icon
: 'icon-secondary'
]
}
>
<span className={styles[iconClassName]}>
<Icon source={XIcon} />
</span>
}