|
|
@ -3,6 +3,11 @@ import { cn } from '../../lib/classname.ts'; |
|
|
|
import { Filter, X } from 'lucide-react'; |
|
|
|
import { Filter, X } from 'lucide-react'; |
|
|
|
import { CategoryFilterButton } from './CategoryFilterButton.tsx'; |
|
|
|
import { CategoryFilterButton } from './CategoryFilterButton.tsx'; |
|
|
|
import { useOutsideClick } from '../../hooks/use-outside-click.ts'; |
|
|
|
import { useOutsideClick } from '../../hooks/use-outside-click.ts'; |
|
|
|
|
|
|
|
import { |
|
|
|
|
|
|
|
deleteUrlParam, |
|
|
|
|
|
|
|
getUrlParams, |
|
|
|
|
|
|
|
setUrlParams, |
|
|
|
|
|
|
|
} from '../../lib/browser.ts'; |
|
|
|
|
|
|
|
|
|
|
|
const groupNames = [ |
|
|
|
const groupNames = [ |
|
|
|
'Absolute Beginners', |
|
|
|
'Absolute Beginners', |
|
|
@ -468,6 +473,15 @@ export function RoadmapsPage() { |
|
|
|
]); |
|
|
|
]); |
|
|
|
}, [activeGroup]); |
|
|
|
}, [activeGroup]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
|
|
const { g } = getUrlParams() as { g: AllowGroupNames }; |
|
|
|
|
|
|
|
if (!g) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setActiveGroup(g); |
|
|
|
|
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="border-t bg-gray-100"> |
|
|
|
<div className="border-t bg-gray-100"> |
|
|
|
<button |
|
|
|
<button |
|
|
@ -502,6 +516,7 @@ export function RoadmapsPage() { |
|
|
|
onClick={() => { |
|
|
|
onClick={() => { |
|
|
|
setActiveGroup(''); |
|
|
|
setActiveGroup(''); |
|
|
|
setIsFilterOpen(false); |
|
|
|
setIsFilterOpen(false); |
|
|
|
|
|
|
|
deleteUrlParam('g'); |
|
|
|
}} |
|
|
|
}} |
|
|
|
category={'All Roadmaps'} |
|
|
|
category={'All Roadmaps'} |
|
|
|
selected={activeGroup === ''} |
|
|
|
selected={activeGroup === ''} |
|
|
@ -514,6 +529,7 @@ export function RoadmapsPage() { |
|
|
|
setActiveGroup(group.group); |
|
|
|
setActiveGroup(group.group); |
|
|
|
setIsFilterOpen(false); |
|
|
|
setIsFilterOpen(false); |
|
|
|
document?.getElementById('filter-button')?.scrollIntoView(); |
|
|
|
document?.getElementById('filter-button')?.scrollIntoView(); |
|
|
|
|
|
|
|
setUrlParams({ g: group.group }); |
|
|
|
}} |
|
|
|
}} |
|
|
|
category={group.group} |
|
|
|
category={group.group} |
|
|
|
selected={activeGroup === group.group} |
|
|
|
selected={activeGroup === group.group} |
|
|
|