Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import truncate from './utils/truncate'
import styles from './styles.css'
import theme from './theme'
/**
---
category: components/deprecated
id: DeprecatedTruncateText
---
**/
@deprecated('7.0.0', null, 'Use @instructure/ui-truncate-text instead.')
@testable()
@themeable(theme, styles)
@hack(['shouldTruncateWhenInvisible'])
class TruncateText extends Component {
static propTypes = {
/**
* The content to be truncated.
*/
children: PropTypes.node.isRequired,
/**
* Number of lines to allow before truncating. `auto` will fit to parent
*/
maxLines: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
/**
* Where to place the ellipsis within the string
*/
position: PropTypes.oneOf(['end', 'middle']),
/**
* Add ellipsis after words or after any character