Skip to content

Commit

Permalink
fix: unexpected linked block container behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
d1snin committed Oct 19, 2023
1 parent 9c045e6 commit 902fa15
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@ class BlockComponent : Component<BlockComponent.Config>(::Config), KoinComponent
val isBare = block.metadata[MetadataKeys.UI_BLOCK_BARE]
?.toBooleanStrictOrNull() == true

var containerConfigured = false

fun SimplePanel.configureContainer() {
if (!containerConfigured) {
applyMargin()
}

addCssClass("w-100")
addCssClass("d-flex")

Expand All @@ -59,17 +65,16 @@ class BlockComponent : Component<BlockComponent.Config>(::Config), KoinComponent

maxWidth = blockSize

applyCompensator()

containerConfigured = true
}

fun SimplePanel.renderCard() {
renderCard("flex-column justify-content-start", bare = isBare) {
configureContainer()

configurePadding(block)

applyMargin()
applyCompensator()

setOptionalBlockId(block)

renderEntities(block)
Expand All @@ -81,7 +86,6 @@ class BlockComponent : Component<BlockComponent.Config>(::Config), KoinComponent
link?.let {
renderFriendlyLink(url = it, external = true) {
configureContainer()

renderCard()
}
} ?: renderCard()
Expand Down

0 comments on commit 902fa15

Please sign in to comment.