Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Comment): add size prop to Group #1327

Merged
5 changes: 5 additions & 0 deletions src/views/Comment/CommentGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function CommentGroup(props) {
children,
collapsed,
minimal,
size,
threaded,
} = props

Expand All @@ -27,6 +28,7 @@ function CommentGroup(props) {
useKeyOnly(minimal, 'minimal'),
useKeyOnly(threaded, 'threaded'),
'comments',
size,
className,
)
const rest = getUnhandledProps(CommentGroup, props)
Expand Down Expand Up @@ -57,6 +59,9 @@ CommentGroup.propTypes = {
/** Comments can hide extra information unless a user shows intent to interact with a comment. */
minimal: PropTypes.bool,

/** Comments can have different sizes*/
size: PropTypes.oneOf(['mini', 'tiny', 'small', 'large', 'big', 'huge', 'massive']),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use SIZES const for definitions, example.


/** A comment list can be threaded to showing the relationship between conversations. */
threaded: PropTypes.bool,
}
Expand Down
3 changes: 3 additions & 0 deletions test/specs/views/Comment/CommentGroup-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ describe('CommentGroup', () => {
common.propKeyOnlyToClassName(CommentGroup, 'collapsed')
common.propKeyOnlyToClassName(CommentGroup, 'minimal')
common.propKeyOnlyToClassName(CommentGroup, 'threaded')
common.propValueOnlyToClassName(CommentGroup, 'size', [
'mini', 'tiny', 'small', 'large', 'big', 'huge', 'massive',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

])
})