|
|
|
@ -81,6 +81,18 @@ export function ProjectsPage(props: ProjectsPageProps) { |
|
|
|
|
(group) => group.id === activeGroup, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
const requiredSortOrder = [ |
|
|
|
|
'Frontend', |
|
|
|
|
'Backend', |
|
|
|
|
'DevOps', |
|
|
|
|
'Full-stack', |
|
|
|
|
'JavaScript', |
|
|
|
|
'Go', |
|
|
|
|
'Python', |
|
|
|
|
'Node.js', |
|
|
|
|
'Java', |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className="border-t bg-gray-100"> |
|
|
|
|
<button |
|
|
|
@ -122,13 +134,33 @@ export function ProjectsPage(props: ProjectsPageProps) { |
|
|
|
|
selected={activeGroup === ''} |
|
|
|
|
/> |
|
|
|
|
|
|
|
|
|
{roadmapsProjects.map((group) => ( |
|
|
|
|
{roadmapsProjects |
|
|
|
|
.sort((a, b) => { |
|
|
|
|
const aIndex = requiredSortOrder.indexOf(a.title); |
|
|
|
|
const bIndex = requiredSortOrder.indexOf(b.title); |
|
|
|
|
|
|
|
|
|
if (aIndex === -1 && bIndex === -1) { |
|
|
|
|
return a.title.localeCompare(b.title); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (aIndex === -1) { |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (bIndex === -1) { |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
return aIndex - bIndex; |
|
|
|
|
}) |
|
|
|
|
.map((group) => ( |
|
|
|
|
<CategoryFilterButton |
|
|
|
|
key={group.id} |
|
|
|
|
onClick={() => { |
|
|
|
|
setActiveGroup(group.id); |
|
|
|
|
setIsFilterOpen(false); |
|
|
|
|
document?.getElementById('filter-button')?.scrollIntoView(); |
|
|
|
|
document |
|
|
|
|
?.getElementById('filter-button') |
|
|
|
|
?.scrollIntoView(); |
|
|
|
|
setVisibleProjects(group.projects); |
|
|
|
|
setUrlParams({ g: group.id }); |
|
|
|
|
}} |
|
|
|
|