Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Alert component layout #4087

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 6 additions & 2 deletions framework/core/less/common/Alert.less
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +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;
}
Loading