generated from shampsdev/react-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dashboard): Created a interactive dashboard to be used with prod. (
#4) * Update cd-dev.yaml * updates lint errors * added test command * added nginx.conf * added better functionality * added map page * added place parsing funcitonality and massive refactor * implemented useQuery, and better state management
- Loading branch information
1 parent
7bc6c58
commit d91581e
Showing
24 changed files
with
740 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { useState } from 'react'; | ||
import { Input } from '@/components/ui/input'; | ||
import { Outlet, useNavigate } from 'react-router-dom'; | ||
import { usePlaces } from '@/shared/hooks/usePlaces'; | ||
|
||
export default function DashboardSidebar() { | ||
const { data: places } = usePlaces(); | ||
const [filter, setFilter] = useState(''); | ||
|
||
const navigate = useNavigate(); | ||
|
||
const filteredPlaces = places?.filter((place) => | ||
place.title.toLowerCase().includes(filter.toLowerCase()) | ||
); | ||
|
||
return ( | ||
<div className="w-full h-full flex"> | ||
<div className="flex flex-col w-[350px] border-gray-100 border-r"> | ||
<div className="p-5 pt-4 space-y-5 border-gray-100 border-b"> | ||
<h1 className="text-xl">All Places</h1> | ||
<Input | ||
placeholder="Filter places..." | ||
value={filter} | ||
onChange={(e) => setFilter(e.target.value)} | ||
/> | ||
</div> | ||
<div className='h-full divide-gray-100 w-full overflow-y-scroll'> | ||
{filteredPlaces?.map((x, index) => ( | ||
<div key={`${x.id}_${index}`} onClick={() => { | ||
navigate(`${x.id}`); | ||
}} className="cursor-pointer px-3 py-2 h-24 hover:bg-gray-100 w-full"> | ||
<p> | ||
{x.title} | ||
</p> | ||
<p className="text-muted-foreground line-clamp-2 text-sm"> | ||
{x.address} | ||
</p> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
<div className="w-full m-5"> | ||
<Outlet /> | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.