Skip to content

Commit

Permalink
fix: alert widget layout
Browse files Browse the repository at this point in the history
  • Loading branch information
YUCLing committed Oct 22, 2024
1 parent 3c7cab1 commit c950c62
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
24 changes: 13 additions & 11 deletions framework/core/js/src/common/components/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,19 @@ export default class Alert<T extends AlertAttrs = AlertAttrs> extends Component<
return (
<div {...attrs}>
<div className={classList('Alert-container', attrs.containerClassName)}>
{!!title && (
<div className="Alert-title">
{!!icon && (
<span className="Alert-title-icon">
<Icon name={icon} />
</span>
)}
<span className="Alert-title-text">{title}</span>
</div>
)}
<span className="Alert-body">{content}</span>
<div className="Alert-content">
{!!title && (
<div className="Alert-title">
{!!icon && (
<span className="Alert-title-icon">
<Icon name={icon} />
</span>
)}
<span className="Alert-title-text">{title}</span>
</div>
)}
<span className="Alert-body">{content}</span>
</div>
<ul className="Alert-controls">{listItems(controls.concat(dismissControl))}</ul>
</div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions framework/core/less/common/Alert.less
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,17 @@
display: none;
}
}
.Alert-content {
flex-direction: column;
}
.Alert-title {
margin-bottom: 8px;
font-weight: bold;
display: flex;
align-items: center;
gap: 8px;
}
.Alert-container {
.Alert-container,
.Alert-content,
.Alert-title {
display: flex;
gap: 8px;
}

0 comments on commit c950c62

Please sign in to comment.