Skip to content

Commit c058c59

Browse files
committed
adjust word to to text on list page
1 parent 92e2c50 commit c058c59

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/components/ListItem.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect } from 'react';
1+
import { useState, useEffect, Fragment } from 'react';
22
import './ListItem.css';
33
import { updateItem, deleteItem } from '../api';
44
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';

src/views/List.jsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ListItem } from '../components';
2-
import { useState, useEffect, Fragment } from 'react';
2+
import { useState, useEffect } from 'react';
33
import BasicModal from './Modal';
44
import { comparePurchaseUrgency } from '../api';
55
import { useVoiceToText } from '../utils';
@@ -32,16 +32,13 @@ export function List({ data, userId, path }) {
3232

3333
useEffect(() => {
3434
if (text) {
35-
setFilterVal((prev) => ({ ...prev, name: text }));
35+
setFilterVal((prev) => prev + ' ' + text);
3636
}
3737
}, [text]);
3838

3939
function handleChange(e) {
4040
e.preventDefault();
41-
setFilterVal((prev) => ({
42-
...prev,
43-
[e.target.name]: e.target.value,
44-
}));
41+
setFilterVal(e.target.value);
4542
}
4643

4744
const clearInput = (e) => {
@@ -114,14 +111,17 @@ export function List({ data, userId, path }) {
114111
<ul className="space-y-2 font-archivo flex-grow overflow-y-auto space-y-4 ">
115112
{filteredObject &&
116113
Object.entries(filteredObject).map(([timeBucket, list]) => (
117-
<li key={crypto.randomUUID()} className="flex flex-col space-y-2">
114+
<div
115+
key={crypto.randomUUID()}
116+
className="flex flex-col space-y-2"
117+
>
118118
<div>
119119
<h3 className="text-white">{labels[timeBucket]}</h3>
120120
</div>
121121
{list.map((item) => (
122122
<ListItem item={item} key={crypto.randomUUID()} />
123123
))}
124-
</li>
124+
</div>
125125
// <Fragment >
126126

127127
// </Fragment>

0 commit comments

Comments
 (0)