diff --git a/app/javascript/gabsocial/components/list_item.js b/app/javascript/gabsocial/components/list_item.js index 901672b5..ea8a3fbc 100644 --- a/app/javascript/gabsocial/components/list_item.js +++ b/app/javascript/gabsocial/components/list_item.js @@ -7,6 +7,7 @@ import Text from './text' const cx = classNames.bind(_s) export default class ListItem extends PureComponent { + static propTypes = { icon: PropTypes.string, isLast: PropTypes.bool, @@ -14,9 +15,12 @@ export default class ListItem extends PureComponent { to: PropTypes.string, href: PropTypes.string, title: PropTypes.string, + subtitle: PropTypes.string, + isActive: PropTypes.bool, onClick: PropTypes.func, size: PropTypes.oneOf([ - 'small', 'large' + 'small', + 'large', ]), hideArrow: PropTypes.bool, } @@ -32,8 +36,16 @@ export default class ListItem extends PureComponent { icon, hideArrow, isHidden, + subtitle, + isActive, } = this.props + if (!title) { + return ( +
+ ) + } + if (isHidden) { return ( @@ -45,6 +57,10 @@ export default class ListItem extends PureComponent { const small = size === 'small' const large = size === 'large' + const textSize = small ? 'small' : large ? 'large' : 'normal' + const iconSize = large ? '14px' : '10px' + const showActive = isActive !== undefined + const containerClasses = cx({ default: 1, cursorPointer: 1, @@ -69,8 +85,11 @@ export default class ListItem extends PureComponent { fillPrimary: 1, }) - const textSize = small ? 'small' : large ? 'large' : 'normal' - const iconSize = large ? '14px' : '10px' + const textContainerClasses = cx({ + default: 1, + pr5: 1, + maxWidth100PC42PX: !hideArrow || showActive, + }) return ( ) } + } \ No newline at end of file