Skip to content

Commit

Permalink
Bug 1600752 - changes based on feedback: TruncatedText button style
Browse files Browse the repository at this point in the history
  • Loading branch information
yogmel committed Dec 18, 2019
1 parent fffb79f commit cba10de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ui/perfherder/alerts/AlertTable.jsx
Expand Up @@ -307,10 +307,10 @@ export default class AlertTable extends React.Component {
{alertSummary.notes && (
<div className="bg-white px-3 py-4">
<TruncatedText
color="info"
title="Notes: "
maxLength={167}
text={alertSummary.notes}
showMoreClass="text-info"
/>
</div>
)}
Expand Down
10 changes: 5 additions & 5 deletions ui/shared/TruncatedText.jsx
Expand Up @@ -11,7 +11,7 @@ export default class TruncatedText extends React.Component {
}

render() {
const { text, maxLength, title, showMoreClass } = this.props;
const { text, maxLength, title, color } = this.props;
const { showMoreResults } = this.state;

return (
Expand All @@ -22,8 +22,10 @@ export default class TruncatedText extends React.Component {
</p>
{text.length > maxLength && (
<Button
color="link"
className={`${showMoreClass} d-block p-0 ml-auto`}
color={color || 'link'}
outline={color}
className={`${color ||
'font-weight-bold text-reset'} d-block ml-auto`}
onClick={() => this.setState({ showMoreResults: !showMoreResults })}
>
{`show ${showMoreResults ? 'less' : 'more'}`}
Expand All @@ -38,10 +40,8 @@ TruncatedText.propTypes = {
text: PropTypes.string.isRequired,
title: PropTypes.string,
maxLength: PropTypes.number.isRequired,
showMoreClass: PropTypes.string,
};

TruncatedText.defaultProps = {
showMoreClass: 'font-weight-bold',
title: '',
};

0 comments on commit cba10de

Please sign in to comment.