Skip to content

Commit

Permalink
Move Frame classnames inline
Browse files Browse the repository at this point in the history
  • Loading branch information
sophschneider committed Apr 10, 2024
1 parent ed8142f commit 39acc63
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions polaris-react/src/components/Frame/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,18 +240,6 @@ class FrameInner extends PureComponent<CombinedProps, State> {
}
: {};

const getFrameClassName = (features: FeaturesConfig) =>
classNames(
styles.Frame,
features?.dynamicTopBarAndReframe && styles['Frame-TopBarAndReframe'],
navigation && styles.hasNav,
topBar && styles.hasTopBar,
sidebar && styles.hasSidebar,
sidebar &&
features?.dynamicTopBarAndReframe &&
styles['hasSidebar-TopBarAndReframe'],
);

const contextualSaveBarMarkup = (
<UseFeatures>
{({dynamicTopBarAndReframe}) =>
Expand Down Expand Up @@ -299,7 +287,17 @@ class FrameInner extends PureComponent<CombinedProps, State> {
<UseFeatures>
{(features) => (
<div
className={getFrameClassName(features)}
className={classNames(
styles.Frame,
features?.dynamicTopBarAndReframe &&
styles['Frame-TopBarAndReframe'],
navigation && styles.hasNav,
topBar && styles.hasTopBar,
sidebar && styles.hasSidebar,
sidebar &&
features?.dynamicTopBarAndReframe &&
styles['hasSidebar-TopBarAndReframe'],
)}
{...layer.props}
{...navigationAttributes}
>
Expand Down

0 comments on commit 39acc63

Please sign in to comment.