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

WysiwygEditor - Change link icon color #2519

Merged
merged 2 commits into from
Jan 9, 2023
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
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.5.2] - 2023-01-09

### Changed

- `WysiwygEditor`: Change link icon color ([@BeirlaenAaron](https://github.com/BeirlaenAaron)) in [#2519](https://github.com/teamleadercrm/ui/pull/2519))

## [18.5.1] - 2023-01-04

### Added
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.5.1",
"version": "18.5.2",
"author": "Teamleader <[email protected]>",
"bugs": {
"url": "https://github.com/teamleadercrm/ui/issues"
Expand Down
14 changes: 13 additions & 1 deletion src/components/wysiwygEditor/decorators/linkDecorator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Link from '../../link';

import { GenericComponent } from '../../../@types/types';
import theme from './theme.css';
import Icon from '../../icon';

const findLinkEntities = (contentBlock: ContentBlock, callback: () => void, contentState: ContentState) => {
contentBlock.findEntityRanges((character) => {
Expand Down Expand Up @@ -42,7 +43,18 @@ const LinkEntity: GenericComponent<LinkEntityProps> = ({ entityKey, contentState
<Link className={theme['link']} inherit={false} onClick={(event: MouseEvent) => event.preventDefault()}>
{children}
</Link>
{showOpenLinkIcon && <IconExternalLinkSmallOutline onClick={openLink} className={theme['icon']} />}
{showOpenLinkIcon && (
<Icon
display="inline-block"
onClick={openLink}
className={theme['icon']}
color="aqua"
tint="dark"
marginLeft={1}
>
<IconExternalLinkSmallOutline />
</Icon>
)}
</Box>
);
};
Expand Down