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 7f80da0
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions polaris-react/src/components/Frame/Frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import type {
} from '../../utilities/frame';
import {UseTheme} from '../../utilities/use-theme';
import {UseFeatures} from '../../utilities/features';
import type {FeaturesConfig} from '../../utilities/features';

import {
ToastManager,
Expand Down Expand Up @@ -240,18 +239,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 +286,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 7f80da0

Please sign in to comment.