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 7, 2023
1 parent 68a3864 commit 29406f6
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 29406f6

Please sign in to comment.