Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

[FIX] Text overflow on Alerts #2496

Merged
merged 4 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

### Dependency updates

## [18.2.3] - 2022-12-16

### Fixed

- `Alert`: Break long words to prevent text overflow ([@JorenSaeyTL](https://github.com/JorenSaeyTL)) in ([#2496](https://github.com/teamleadercrm/ui/pull/2496))

## [18.2.2] - 2022-12-16

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@teamleader/ui",
"description": "Teamleader UI library",
"version": "18.2.2",
"version": "18.2.3",
"author": "Teamleader <[email protected]>",
"bugs": {
"url": "https://github.com/teamleadercrm/ui/issues"
Expand Down
7 changes: 5 additions & 2 deletions src/components/alert/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Illustration60X60Error, Illustration60X60Info } from '@teamleader/ui-il
import { DialogBaseProps } from '../dialog/DialogBase';
import { ButtonProps } from '../button/Button';
import { GenericComponent } from '../../@types/types';
import theme from './theme.css';

type Action = Omit<ButtonProps, 'fullWidth' | 'marginTop'>;

Expand Down Expand Up @@ -39,9 +40,11 @@ const Alert: GenericComponent<AlertProps> = ({
<Box marginBottom={3} marginTop={2}>
{type === 'confirm' ? <Illustration60X60Info /> : <Illustration60X60Error />}
</Box>
<Heading3 color="teal">{title}</Heading3>
<Heading3 className={theme['break-word']} color="teal">
{title}
</Heading3>
{body && (
<TextBody color="teal" marginTop={2}>
<TextBody className={theme['break-word']} color="teal" marginTop={2}>
{body}
</TextBody>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ exports[`Component - Alert renders 1`] = `
</svg>
</div>
<h3
class="box heading heading-3 darkest teal"
class="box heading heading-3 darkest teal break-word"
data-teamleader-ui="heading"
>
Alert title
</h3>
<p
class="box margin-top-2 text text-body darkest teal"
class="box margin-top-2 text text-body darkest teal break-word"
data-teamleader-ui="text"
>
I am the alert body text
Expand Down
3 changes: 3 additions & 0 deletions src/components/alert/theme.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.break-word {
word-break: break-word;
}