Skip to content

ListGroup doc #185#236

Merged
eddywashere merged 10 commits intoreactstrap:masterfrom
LiJinyao:ListGroup-doc
Dec 1, 2016
Merged

ListGroup doc #185#236
eddywashere merged 10 commits intoreactstrap:masterfrom
LiJinyao:ListGroup-doc

Conversation

@LiJinyao
Copy link
Copy Markdown
Contributor

@LiJinyao LiJinyao commented Nov 24, 2016

#185 Add ListGroup doc.

API Change in ListGroupItem component:
When I write doc, I found that using color="success" to set contextual class is not a good idea.

The color prop is no longer support, when you want to set a contextual class, just pass the name (one of “success”, “info”, “warning”, “danger”) to the component.

Since this component is not exists in doc yet and just released a few days, I think the change is acceptable.

# Conflicts:
#	docs/lib/Components/index.js
#	docs/lib/routes.js
#	webpack.dev.config.js
I use a color prop to pass contextual classes info to the component,
when you want to set a status, you must type `color=“success”`. It
trivially to do so.
Now you just need pass a `success` bool prop to show the status.
@LiJinyao LiJinyao changed the title ListGroup doc ListGroup doc #185 Nov 24, 2016
@eddywashere
Copy link
Copy Markdown
Member

@LiJinyao why remove color prop when that's a standard prop reactstrap uses for applying color classes? It's a good approach for a single choice based prop. We normally use boolean props to apply one off classes, classes that can be combined or used to apply a safe default.

@LiJinyao
Copy link
Copy Markdown
Contributor Author

@eddywashere Oh I haven't notice that it is a standard prop. I'll change it back.
Why I make this change is color="info" needs more type then just a info on off prop. But after your review I found that it is not convenient for generating color props.

Comment thread docs/lib/Components/ListGroupPage.js Outdated
</pre>


<h4>Container Properties</h4>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you remove the container docs from this

Comment thread src/ListGroupItem.js
);

// Prevent click event when disabled.
if (disabled) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was going to ask to convert this to a normal component to make use of instance methods like onClick in Button but this is basically the same thing. Neat! I believe a new function is assigned each time it is rendered as disabled. Can you move this logic to a const handleDisabledOnClick that's assigned outside of the ListGroupItem function.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

OK,I'll do it as soon as possible :)

Copy link
Copy Markdown
Member

@eddywashere eddywashere left a comment

Choose a reason for hiding this comment

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

Minor changes requested. This is looking great @LiJinyao!

@eddywashere eddywashere mentioned this pull request Nov 28, 2016
Copy link
Copy Markdown
Member

@eddywashere eddywashere left a comment

Choose a reason for hiding this comment

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

woot!

@eddywashere eddywashere merged commit 1301b11 into reactstrap:master Dec 1, 2016
@LiJinyao LiJinyao deleted the ListGroup-doc branch December 10, 2016 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants