Skip to content

Commit e0e538e

Browse files
committed
Moved search filter in occupied component
Applications are now filtered inside of mapping function
1 parent 3337f85 commit e0e538e

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

app/components/ApplicationsCard/ApplicationsCard.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ const ApplicationsCard = (props) => {
7979
>
8080
<div className="databaseIconContainer">
8181
<div className="databaseIconHeader">
82-
{/* {application[1] === 'SQL' ? (
83-
<img className="databaseIcon" alt="SQL" />
84-
) : (
85-
<img className="databaseIcon" alt="MongoDB" />
86-
)} */}
8782
</div>
8883
</div>
8984

app/components/Occupied/Occupied.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import DashboardIcons from '../DashboardIcons/DashboardIcons';
3434
import ApplicationsCard from '../ApplicationsCard/ApplicationsCard';
3535

3636
import { useStylesLight, useStylesDark } from './helpers/muiHelper'
37-
import { Link } from 'react-router-dom';
3837

3938
//v10: Memoized function, without any props. Should theoretically be called only once.
4039
const Occupied = React.memo(() => {
@@ -91,12 +90,12 @@ const Occupied = React.memo(() => {
9190
}
9291

9392
{applications
94-
95-
// .filter((db: any) => db[0].toLowerCase().includes(searchTerm.toLowerCase()))
9693
.map((application: string[], i: any) => {
97-
9894
const description = application[3]
99-
if(!example && description === "Example") return <></>
95+
const cardName = application[0]
96+
const isFiltered = cardName.toLowerCase().includes(searchTerm.toLowerCase())
97+
98+
if((!example && description === "Example") || !isFiltered) return <></>
10099
return (
101100
<ApplicationsCard
102101
key={crypto.randomUUID()}

0 commit comments

Comments
 (0)