Skip to content

Commit 76c0299

Browse files
committed
Feature: Make Link full width of line
1 parent 9d0061a commit 76c0299

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

packages/react-ui-components/src/SelectBox_Option_SingleLine/selectBox_Option_SingleLine.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class SelectBox_Option_SingleLine extends PureComponent {
1818

1919
className: PropTypes.string,
2020

21+
icon: PropTypes.string,
22+
2123
linkOptions: PropTypes.shape({
2224
href: PropTypes.string.isRequired,
2325
target: PropTypes.string,
@@ -35,14 +37,19 @@ class SelectBox_Option_SingleLine extends PureComponent {
3537
[className]: className,
3638
[style.linkedItem]: linkOptions
3739
});
40+
const linkClassname = mergeClassNames({
41+
[style.dropdownLink]: true,
42+
[style.hasIcon]: (option.icon || icon ? true: false)
43+
});
44+
3845
const previewElementIcon = option.icon ? option.icon : (icon ? icon : null);
3946

4047
return (
4148
<ListPreviewElement {...this.props} icon={previewElementIcon} disabled={isDisabled} className={finalClassNames}>
4249
{linkOptions ? (
4350
<a
4451
{...linkOptions}
45-
className={style.dropdownLink}
52+
className={linkClassname}
4653
title={option.title ? option.title : option.label}>{option.label}</a>
4754
) : (
4855
<span title={option.title ? option.title : option.label}>{option.label}</span>

packages/react-ui-components/src/SelectBox_Option_SingleLine/style.module.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
color: white;
33
padding: 5px 14px;
44
display: inline-block;
5+
width: 100%;
6+
7+
}
8+
.hasIcon {
9+
width: calc(100% - 2em);
10+
padding: 5px 0px;
511
}
612
.linkedItem{
713
padding: 0px !important;

0 commit comments

Comments
 (0)