Skip to content

Commit

Permalink
Merge pull request #198 from the-control-group/release/1.9.5
Browse files Browse the repository at this point in the history
Add Label Prop to PasswordInput
  • Loading branch information
mattdizon authored Dec 8, 2022
2 parents 22e79e8 + 9b2c55f commit f09a3e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@the-control-group/ui",
"version": "1.9.4",
"version": "1.9.5",
"description": "UI kit based on ReactJS for TCG projects",
"main": "lib/index.js",
"files": [
Expand Down
10 changes: 7 additions & 3 deletions src/elements/PasswordInput/PasswordInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const PasswordInput = ({
bare,
name,
id,
label,
...other
}) => {
const combinedClasses = classNames(
Expand All @@ -46,8 +47,11 @@ const PasswordInput = ({

return (
<Fragment>

<Label htmlFor={other.id}>Password</Label>
{!!label &&
<Label htmlFor={other.id}>
{label}
</Label>
}

<Common
{...other}
Expand Down Expand Up @@ -80,8 +84,8 @@ PasswordInput.propTypes = {
/** HTML DOM attribute */
bare: PropTypes.bool,
name: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
id: PropTypes.string
};

export default PasswordInput;

0 comments on commit f09a3e5

Please sign in to comment.