diff options
author | rohan09-raj <[email protected]> | 2022-08-02 00:06:39 +0530 |
---|---|---|
committer | rohan09-raj <[email protected]> | 2022-08-02 00:06:39 +0530 |
commit | 5f8f6f98c2c47ca878aadb893b0d64a0c66316aa (patch) | |
tree | c32ee819c446a47f9eed15d44330a19d31b6e9b3 /client/src/components | |
parent | 337b0a2a7d358a597e114197cf5d12e8ed81a19e (diff) |
added useState and made input functional
Diffstat (limited to 'client/src/components')
-rw-r--r-- | client/src/components/Input/Input.jsx | 4 | ||||
-rw-r--r-- | client/src/components/LabelCard/LabelCard.jsx | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/client/src/components/Input/Input.jsx b/client/src/components/Input/Input.jsx index ee79f3b..5987e27 100644 --- a/client/src/components/Input/Input.jsx +++ b/client/src/components/Input/Input.jsx @@ -1,7 +1,7 @@ import React from 'react' import styles from './Input.module.css' -const Input = ({ label, id, value, type, name }) => { +const Input = ({ label, id, value, type, name, onChange, placeholder }) => { return ( <div className={styles.input}> <div className={styles.input__container}> @@ -12,7 +12,9 @@ const Input = ({ label, id, value, type, name }) => { id={id} name={name} value={value} + onChange={onChange} required + placeholder={placeholder} /> </div> </div> diff --git a/client/src/components/LabelCard/LabelCard.jsx b/client/src/components/LabelCard/LabelCard.jsx index be02f01..42ba7bf 100644 --- a/client/src/components/LabelCard/LabelCard.jsx +++ b/client/src/components/LabelCard/LabelCard.jsx @@ -1,7 +1,7 @@ import React from 'react' import styles from './LabelCard.module.css' -const LabelCard = ({ id, name, value, title, image }) => { +const LabelCard = ({ id, name, value, title, image, onChange }) => { return ( <div className={styles.labelcard}> <label htmlFor={id} className={styles.card}> @@ -15,6 +15,7 @@ const LabelCard = ({ id, name, value, title, image }) => { name={name} value={value} required + onChange={onChange} /> </div> ) |