Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
BodyClass classes inline
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiggr committed Apr 11, 2022
1 parent b639387 commit c79695a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/customizations/volto/components/theme/View/View.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,17 @@ class View extends Component {
const RenderedView =
this.getViewByType() || this.getViewByLayout() || this.getViewDefault();

const cleanedViewClass = RenderedView.displayName
? `view-${this.cleanViewName(RenderedView.displayName)}`
: null;

return (
<div id="view">
<ContentMetadataTags content={this.props.content} />
{/* Body class if displayName in component is set */}
<BodyClass className={cleanedViewClass} />
<BodyClass
className={
RenderedView.displayName
? `view-${this.cleanViewName(RenderedView.displayName)}`
: null
}
/>
{this.props.loading && (
<Dimmer active inverted>
<Loader size="massive" />
Expand Down

0 comments on commit c79695a

Please sign in to comment.