fix(blocksAntd): Fix margin in Alert when message is none.

This commit is contained in:
Gervwyk 2021-09-18 20:07:46 +02:00
parent 047e2c2ca1
commit 406686994f
3 changed files with 55 additions and 10 deletions

View File

@ -37,8 +37,11 @@ const AlertBlock = ({ blockId, events, methods, properties }) => {
description={renderHtml({ html: properties.description, methods })}
id={blockId}
message={
renderHtml({ html: properties.message, methods }) ||
(type.isNone(properties.description) && <div style={{ height: '1.5175em' }}></div>)
type.isNone(properties.message) ? (
<div style={{ marginBottom: -4 }}></div>
) : (
renderHtml({ html: properties.message, methods })
)
}
onClose={() => methods.triggerEvent({ name: 'onClose' })}
showIcon={properties.showIcon === false ? false : true}

View File

@ -13,7 +13,7 @@ Array [
"message": <div
style={
Object {
"height": "1.5175em",
"marginBottom": -4,
}
}
/>,
@ -614,7 +614,13 @@ Array [
}
/>,
"id": "with description only",
"message": false,
"message": <div
style={
Object {
"marginBottom": -4,
}
}
/>,
"onClose": [Function],
"showIcon": true,
"type": undefined,
@ -644,7 +650,13 @@ Array [
}
/>,
"id": "with description only and icon false",
"message": false,
"message": <div
style={
Object {
"marginBottom": -4,
}
}
/>,
"onClose": [Function],
"showIcon": false,
"type": undefined,
@ -1414,7 +1426,13 @@ Array [
}
/>,
"id": "with description uses html",
"message": false,
"message": <div
style={
Object {
"marginBottom": -4,
}
}
/>,
"onClose": [Function],
"showIcon": true,
"type": undefined,

View File

@ -35,7 +35,7 @@ exports[`Render default - value[0] 1`] = `
<div
style={
Object {
"height": "1.5175em",
"marginBottom": -4,
}
}
/>
@ -780,7 +780,15 @@ exports[`Render with description only - value[0] 1`] = `
>
<div
className="ant-alert-message"
/>
>
<div
style={
Object {
"marginBottom": -4,
}
}
/>
</div>
<div
className="ant-alert-description"
>
@ -804,7 +812,15 @@ exports[`Render with description only and icon false - value[0] 1`] = `
>
<div
className="ant-alert-message"
/>
>
<div
style={
Object {
"marginBottom": -4,
}
}
/>
</div>
<div
className="ant-alert-description"
>
@ -1650,7 +1666,15 @@ exports[`Render with description uses html - value[0] 1`] = `
>
<div
className="ant-alert-message"
/>
>
<div
style={
Object {
"marginBottom": -4,
}
}
/>
</div>
<div
className="ant-alert-description"
>