Skip to content

Commit

Permalink
removed redundant code and commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
arandel1 committed Oct 2, 2024
1 parent 8365678 commit d33ab33
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/views/ShareList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,6 @@ export function ShareList({ userId, list }) {

const [email, setEmail] = useState('');

const { text, isListening, startListening } = useVoiceToText();

useEffect(() => {
if (text) {
setFormData((prev) => ({ ...prev, name: text }));
}
}, [text]);

function handleChange(e) {
e.preventDefault();
setFormData((prev) => ({
...prev,
[e.target.name]: e.target.value,
}));
}
function handleEmailChange(e) {
e.preventDefault();
setEmail(e.target.value);
Expand All @@ -48,13 +33,14 @@ export function ShareList({ userId, list }) {
<input
id="invite-email"
type="text"
placeholder="Type here"
name="email"
value={email}
onChange={handleEmailChange}
required
></input>

<button type="submit">Invite my friend</button>
<button type="submit">Share List</button>
</form>
</div>
</>
Expand Down

0 comments on commit d33ab33

Please sign in to comment.