Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

feat(label): added label component to library #84

Merged
merged 3 commits into from
Nov 15, 2019

Conversation

gqycloud
Copy link
Contributor

@gqycloud gqycloud commented Oct 30, 2019

Fixes #65 .

  • Added label to component library
  • Also auto updated doc-gen md files

@jsf-clabot
Copy link

jsf-clabot commented Oct 30, 2019

CLA assistant check
All committers have signed the CLA.

@matteovivona matteovivona added enhancement New feature or request in progress labels Oct 30, 2019
@matteovivona matteovivona added this to the v1.0.0 milestone Oct 30, 2019
import React, { Component } from 'react'
import FormLabel from 'react-bootstrap/FormLabel'

interface Props {
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

@jackcmeyer jackcmeyer Oct 31, 2019

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!

/**
* Labels are used to display textnpm
*/
class Label extends Component<Props, {}> {
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

@jackcmeyer jackcmeyer Oct 31, 2019

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.

test/badge.test.tsx Show resolved Hide resolved
@jackcmeyer
Copy link
Member

@gqycloud Thanks for your work! Just a couple points of feedback!

jackcmeyer
jackcmeyer previously approved these changes Nov 13, 2019
@matteovivona matteovivona merged commit 8744bc0 into HospitalRun:master Nov 15, 2019
@ghost
Copy link

ghost commented Nov 15, 2019

🎉 This PR is included in version 0.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ghost ghost added the released label Nov 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Labels
5 participants