Skip to content

Commit

Permalink
[WIP] Remove usage of useBreakpoints from <Banner>
Browse files Browse the repository at this point in the history
  • Loading branch information
jesstelford committed Oct 19, 2023
1 parent 731328a commit 84f59ce
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions polaris-react/src/components/Banner/Banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import type {IconProps} from '../Icon';
import {BannerContext} from '../../utilities/banner-context';
import {WithinContentContext} from '../../utilities/within-content-context';
import {classNames} from '../../utilities/css';
import {useBreakpoints} from '../../utilities/breakpoints';
import {useI18n} from '../../utilities/i18n';
import {useEventListener} from '../../utilities/use-event-listener';
import {BlockStack} from '../BlockStack';
Expand Down Expand Up @@ -190,7 +189,6 @@ export function DefaultBanner({
dismissButton,
children,
}: PropsWithChildren<BannerLayoutProps>) {
const {smUp} = useBreakpoints();
const hasContent = children || actionButtons;

return (
Expand All @@ -199,10 +197,10 @@ export function DefaultBanner({
<Box
background={backgroundColor}
color={textColor}
borderStartStartRadius={smUp ? '300' : undefined}
borderStartEndRadius={smUp ? '300' : undefined}
borderEndStartRadius={!hasContent && smUp ? '300' : undefined}
borderEndEndRadius={!hasContent && smUp ? '300' : undefined}
borderStartStartRadius={{sm: '300'}}
borderStartEndRadius={{sm: '300'}}
borderEndStartRadius={!hasContent ? {sm: '300'} : undefined}
borderEndEndRadius={!hasContent ? {sm: '300'} : undefined}
padding="300"
>
<InlineStack
Expand Down

0 comments on commit 84f59ce

Please sign in to comment.