Skip to content

Commit

Permalink
cleaned up code
Browse files Browse the repository at this point in the history
  • Loading branch information
arandel1 committed Oct 2, 2024
1 parent d33ab33 commit e0b9bbc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/views/List.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ListItem } from '../components';
import { useState, useEffect, Fragment } from 'react';
import BasicModal from './Modal';
import { comparePurchaseUrgency } from '../api';
import ShareIcon from '@mui/icons-material/Share';

export function List({ data, userId }) {
const [filterVal, setFilterVal] = useState('');
Expand Down
10 changes: 2 additions & 8 deletions src/views/ManageList.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { useState, useEffect } from 'react';
import { addItem, shareList } from '../api';
import { addItem } from '../api';
import { useVoiceToText } from '../utils';
import KeyboardVoiceIcon from '@mui/icons-material/KeyboardVoice';

export function ManageList({ userId, list }) {
export function ManageList({ list }) {
const [formData, setFormData] = useState({
name: '',
frequency: '',
});

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

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

useEffect(() => {
Expand All @@ -26,10 +24,6 @@ export function ManageList({ userId, list }) {
[e.target.name]: e.target.value,
}));
}
function handleEmailChange(e) {
e.preventDefault();
setEmail(e.target.value);
}

function handleSubmit(e) {
e.preventDefault();
Expand Down
15 changes: 7 additions & 8 deletions src/views/ShareList.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { useState, useEffect } from 'react';
import { addItem, shareList } from '../api';
import { useVoiceToText } from '../utils';
import { useState } from 'react';
import { shareList } from '../api';

export function ShareList({ userId, list }) {
const [formData, setFormData] = useState({
name: '',
frequency: '',
});
export function ShareList({ userId }) {
// const [formData, setFormData] = useState({
// name: '',
// frequency: '',
// });

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

Expand Down

0 comments on commit e0b9bbc

Please sign in to comment.