-
-
Notifications
You must be signed in to change notification settings - Fork 186
feat(label): added label component to library #84
Conversation
import React, { Component } from 'react' | ||
import FormLabel from 'react-bootstrap/FormLabel' | ||
|
||
interface Props { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we might want to support htmlFor
so we can tie form controls to their labels if necessary.
What do do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to add this prop, on that note what are you thoughts on adding a column prop to support horizontal forms? Do we have any plans to use horizontal forms or any plans to in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No plans that I know of yet. But if it’s simple enough to add, no harm in it!
src/components/Label/Label.tsx
Outdated
/** | ||
* Labels are used to display textnpm | ||
*/ | ||
class Label extends Component<Props, {}> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this component be better as a functional component?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially I was going to use a functional component here but after looking at some of the other bootstrap components (i.e textInput, textField, radio, badge, ect) I noticed that we tend towards using React Components. I wasn't sure if it was an explicit decision or not so I choose to follow the paradigm in the other components on this initial cut.
I'm happy to change this component to a functional one for now though, what are you thoughts on adding a ticket for refactoring the other bootstrap components to functional components?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually refactored most of the components last night 😀 #85.
@gqycloud Thanks for your work! Just a couple points of feedback! |
🎉 This PR is included in version 0.15.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #65 .