Skip to content

Commit e2318ab

Browse files
author
marcoDmc
committed
feat: adding function that handles mobile menu state
1 parent f9aa7b1 commit e2318ab

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/components/Header/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ export interface IHeader extends React.ComponentPropsWithoutRef<'div'> {
22
title: string;
33
startAdornment?: React.ReactNode;
44
endAdornment?: React.ReactNode;
5+
handleStatusHamburguer: () => void;
6+
statusHamburguer: boolean
57
}

src/pages/Home/Home.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const Home = () => {
3333
...qs.parse(new URLSearchParams(window.location.search).toString()),
3434
});
3535

36+
const [status, setStatus] = useState(false)
37+
3638
const [, setSearch] = useThrottle<string>(
3739
{
3840
throttle: 400,
@@ -95,6 +97,7 @@ const Home = () => {
9597
);
9698
}, [refresh, filterData, shelters.filters, shelters.page, shelters.perPage]);
9799

100+
const handleStatusHamburguer = () => setStatus(prev => !prev)
98101
return (
99102
<div className="flex flex-col h-screen items-center">
100103
{isModalOpen && (
@@ -150,6 +153,8 @@ const Home = () => {
150153
)}
151154
</div>
152155
}
156+
statusHamburguer={status}
157+
handleStatusHamburguer={handleStatusHamburguer}
153158
/>
154159
<ShelterListView
155160
loading={loading}

0 commit comments

Comments
 (0)