Skip to content

Commit

Permalink
Feature: Make Link full width of line
Browse files Browse the repository at this point in the history
  • Loading branch information
pKallert committed Jan 3, 2024
1 parent 9d0061a commit f642c52
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class SelectBox_Option_SingleLine extends PureComponent {

className: PropTypes.string,

icon: PropTypes.string,

linkOptions: PropTypes.shape({
href: PropTypes.string.isRequired,
target: PropTypes.string,
Expand All @@ -35,14 +37,22 @@ class SelectBox_Option_SingleLine extends PureComponent {
[className]: className,
[style.linkedItem]: linkOptions
});
const linkClassname = mergeClassNames({
[style.dropdownLink]: true,
[style.hasIcon]: (option.icon || icon ? true: false)

Check failure on line 42 in packages/react-ui-components/src/SelectBox_Option_SingleLine/selectBox_Option_SingleLine.js

View workflow job for this annotation

GitHub Actions / Code style

Unnecessary use of boolean literals in conditional expression

Check failure on line 42 in packages/react-ui-components/src/SelectBox_Option_SingleLine/selectBox_Option_SingleLine.js

View workflow job for this annotation

GitHub Actions / Code style

Operator ':' must be spaced
});
if(option.icon){

Check failure on line 44 in packages/react-ui-components/src/SelectBox_Option_SingleLine/selectBox_Option_SingleLine.js

View workflow job for this annotation

GitHub Actions / Code style

Expected space(s) after "if"

Check failure on line 44 in packages/react-ui-components/src/SelectBox_Option_SingleLine/selectBox_Option_SingleLine.js

View workflow job for this annotation

GitHub Actions / Code style

Missing space before opening brace
console.log(linkClassname)
console.log(option.icon);
}
const previewElementIcon = option.icon ? option.icon : (icon ? icon : null);

return (
<ListPreviewElement {...this.props} icon={previewElementIcon} disabled={isDisabled} className={finalClassNames}>
{linkOptions ? (
<a
{...linkOptions}
className={style.dropdownLink}
className={linkClassname}
title={option.title ? option.title : option.label}>{option.label}</a>
) : (
<span title={option.title ? option.title : option.label}>{option.label}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
color: white;
padding: 5px 14px;
display: inline-block;
width: 100%;

}
.hasIcon {
width: calc(100% - 2em);
padding: 5px 0px;
}
.linkedItem{
padding: 0px !important;
Expand Down

0 comments on commit f642c52

Please sign in to comment.