Skip to content

Commit

Permalink
feat: css handle in LayoutContainer to prevent CLS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
iago1501 authored Dec 17, 2024
2 parents a088041 + b61f20a commit 4299a4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- Class to `<div>` elements in `LayoutContainer` to manipulate those sections

## [8.135.0] - 2024-12-09

## [8.134.11] - 2024-09-30
Expand Down
8 changes: 7 additions & 1 deletion react/components/LayoutContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ const Container: FunctionComponent<ContainerProps> = ({
if (elements === '__children__') {
return <>{children}</>
}

const elementIdRegex = /#(.*)/
const elementId = elements.match(elementIdRegex)
const containerClass = !elements.includes('fold')
? `vtex-render__container-id-${elementId ? elementId[1] : elements}`
: ''
return (
<div className={isRow ? '' : className}>
<div className={isRow ? containerClass : className}>
<ExtensionPoint id={elements} {...props} />
</div>
)
Expand Down

0 comments on commit 4299a4c

Please sign in to comment.