-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code refactor to reusable components like Buttons and Checkbox
- Loading branch information
1 parent
6aeae25
commit d30e110
Showing
5 changed files
with
45 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const Button = ({ text, customClass, onClick }) => { | ||
return ( | ||
<button className={customClass} onClick={onClick}> | ||
{text} | ||
</button> | ||
); | ||
}; | ||
export default Button; |
11 changes: 11 additions & 0 deletions
11
src/projects/06-password-generator/components/Checkbox.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const Checkbox = ({ state, onChange, title }) => { | ||
return ( | ||
<div className="checkbox"> | ||
<label> | ||
<input type="checkbox" checked={state} onChange={onChange} /> | ||
{title} | ||
</label> | ||
</div> | ||
); | ||
}; | ||
export default Checkbox; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters