Skip to content

Commit

Permalink
change isWrappable to displayType
Browse files Browse the repository at this point in the history
  • Loading branch information
ryankeairns committed Jan 18, 2019
1 parent cc06303 commit ff5af1d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Adds `isWrappable` prop that wraps `EuiListGroupItem` text ([#1458](https://github.com/elastic/eui/pull/1458))
- Adds `displayType` prop that enables `EuiListGroupItem` text to wrap ([#1458](https://github.com/elastic/eui/pull/1458))

## [`6.5.1`](https://github.com/elastic/eui/tree/v6.5.1)

Expand Down
6 changes: 3 additions & 3 deletions src-docs/src/views/nav_drawer/nav_drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export default class extends Component {
size: 's',
style: { color: 'inherit' },
'aria-label': 'My dashboard',
isWrappable: true,
displayType: 'wrapText',
extraAction: {
color: 'subdued',
iconType: 'starEmpty',
Expand All @@ -344,7 +344,7 @@ export default class extends Component {
size: 's',
style: { color: 'inherit' },
'aria-label': 'Workpad with title that wraps',
isWrappable: true,
displayType: 'wrapText',
extraAction: {
color: 'subdued',
iconType: 'starEmpty',
Expand All @@ -359,7 +359,7 @@ export default class extends Component {
size: 's',
style: { color: 'inherit' },
'aria-label': 'My logs',
isWrappable: true,
displayType: 'wrapText',
extraAction: {
color: 'subdued',
iconType: 'starEmpty',
Expand Down
2 changes: 1 addition & 1 deletion src/components/list_group/_list_group_item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
font-size: $euiFontSizeL;
}

.euiListGroupItem-isWrappable {
.euiListGroupItem-wrapText {
.euiListGroupItem__button {
width: 100%;
word-break: break-word;
Expand Down
7 changes: 3 additions & 4 deletions src/components/list_group/list_group_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const EuiListGroupItem = ({
label,
isActive,
isDisabled,
isWrappable,
displayType,
href,
className,
iconType,
Expand All @@ -34,7 +34,7 @@ export const EuiListGroupItem = ({
'euiListGroupItem-isActive': isActive,
'euiListGroupItem-isDisabled': isDisabled,
'euiListGroupItem-isClickable': href || onClick,
'euiListGroupItem-isWrappable': isWrappable,
'euiListGroupItem-wrapText': displayType && displayType === 'wrapText',
},
className
);
Expand Down Expand Up @@ -131,7 +131,7 @@ EuiListGroupItem.propTypes = {
/**
* Allow link text to wrap
*/
isWrappable: PropTypes.bool,
displayType: PropTypes.oneOf(['wrapText']),

/**
* Make the list item label a link
Expand All @@ -158,6 +158,5 @@ EuiListGroupItem.propTypes = {
EuiListGroupItem.defaultProps = {
isActive: false,
isDisabled: false,
isWrappable: false,
size: 'm',
};

0 comments on commit ff5af1d

Please sign in to comment.