diff --git a/src/js/common/components/Widgets/ReadMore.jsx b/src/js/common/components/Widgets/ReadMore.jsx index d31df520c..d023d8664 100644 --- a/src/js/common/components/Widgets/ReadMore.jsx +++ b/src/js/common/components/Widgets/ReadMore.jsx @@ -1,11 +1,10 @@ import PropTypes from 'prop-types'; import React, { Component } from 'react'; -import TextTruncate from 'react-text-truncate'; // TODO APRIL 2021: This doesn't support the latest React libs, can't we do the same with css? (See note below) -import { renderLog } from '../../utils/logging'; - +// import TextTruncate from 'react-text-truncate'; // TODO APRIL 2021: This doesn't support the latest React libs, can't we do the same with css? (See note below) // 2021-02-23 NOTE FROM DALE: I'd like to try to upgrade ReadMore to use react-truncate-markup // This newer package supports truncating JSX, and isn't limited to text only: -// import TruncateMarkup from 'react-truncate-markup'; +import TruncateMarkup from 'react-truncate-markup'; +import { renderLog } from '../../utils/logging'; export default class ReadMore extends Component { constructor (...args) { @@ -111,39 +110,42 @@ export default class ReadMore extends Component { if (notEnoughTextToTruncate) { return {expandedTextToDisplay}; } + + const showMoreEllipsis = ( + + … + {' '} + + {linkText} + + + + ); + if (this.state.readMore) { return ( - - - {linkText} - - )} - /> + + + + {textToDisplay} + + ); } else { return ( - - {' '} + + {expandedTextToDisplay} -    -