Highlight official roadmaps, add changelog

pull/7382/head
Kamran Ahmed 2 months ago
parent e3224cb7b1
commit 53cda20ddb
  1. 16
      src/components/Navigation/Navigation.astro
  2. 20
      src/components/NavigationDropdown.tsx
  3. 33
      src/components/RoadmapDropdownMenu/RoadmapDropdownMenu.tsx

@ -46,6 +46,22 @@ import { RoadmapDropdownMenu } from '../RoadmapDropdownMenu/RoadmapDropdownMenu'
<a href='/teams' class='group relative text-gray-400 hover:text-white'> <a href='/teams' class='group relative text-gray-400 hover:text-white'>
Teams Teams
</a> </a>
<a
href='/changelog'
class='group relative text-blue-300 hover:text-white hidden md:block ml-0.5'
>
Changelog
<span class='absolute -right-[11px] top-0'>
<span class='relative flex h-2 w-2'>
<span
class='absolute inline-flex h-full w-full animate-ping rounded-full bg-sky-400 opacity-75'
></span>
<span class='relative inline-flex h-2 w-2 rounded-full bg-sky-500'
></span>
</span>
</span>
</a>
</div> </div>
</div> </div>

@ -6,7 +6,7 @@ import {
Menu, Menu,
Shirt, Shirt,
Video, Video,
Waypoints, Map,
} from 'lucide-react'; } from 'lucide-react';
import { useEffect, useRef, useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import { cn } from '../lib/classname.ts'; import { cn } from '../lib/classname.ts';
@ -22,31 +22,36 @@ const links = [
link: '/roadmaps', link: '/roadmaps',
label: 'Official Roadmaps', label: 'Official Roadmaps',
description: 'Made by subject matter experts', description: 'Made by subject matter experts',
Icon: Waypoints, Icon: Map,
isHighlighted: true,
}, },
{ {
link: '/projects', link: '/projects',
label: 'Projects', label: 'Projects',
description: 'Skill-up with real-world projects', description: 'Skill-up with real-world projects',
Icon: FolderKanban, Icon: FolderKanban,
isHighlighted: false,
}, },
{ {
link: '/best-practices', link: '/best-practices',
label: 'Best Practices', label: 'Best Practices',
description: "Do's and don'ts", description: "Do's and don'ts",
Icon: CheckSquare, Icon: CheckSquare,
isHighlighted: false,
}, },
{ {
link: '/questions', link: '/questions',
label: 'Questions', label: 'Questions',
description: 'Test and Practice your knowledge', description: 'Test and Practice your knowledge',
Icon: FileQuestion, Icon: FileQuestion,
isHighlighted: false,
}, },
{ {
link: '/guides', link: '/guides',
label: 'Guides', label: 'Guides',
description: 'In-depth articles and tutorials', description: 'In-depth articles and tutorials',
Icon: BookOpenText, Icon: BookOpenText,
isHighlighted: false,
}, },
{ {
link: 'https://youtube.com/@roadmapsh', link: 'https://youtube.com/@roadmapsh',
@ -54,6 +59,7 @@ const links = [
description: 'Animated and interactive content', description: 'Animated and interactive content',
Icon: Video, Icon: Video,
isExternal: true, isExternal: true,
isHighlighted: false,
}, },
{ {
link: 'https://cottonbureau.com/people/roadmapsh', link: 'https://cottonbureau.com/people/roadmapsh',
@ -61,12 +67,14 @@ const links = [
description: 'Get some cool swag', description: 'Get some cool swag',
Icon: Shirt, Icon: Shirt,
isExternal: true, isExternal: true,
isHighlighted: false,
}, },
{ {
link: '/advertise', link: '/advertise',
label: 'Advertise', label: 'Advertise',
description: 'Promote your product or service', description: 'Promote your product or service',
Icon: Menu, Icon: Menu,
isHighlighted: false,
}, },
]; ];
@ -115,7 +123,13 @@ export function NavigationDropdown() {
target={link.isExternal ? '_blank' : undefined} target={link.isExternal ? '_blank' : undefined}
rel={link.isExternal ? 'noopener noreferrer' : undefined} rel={link.isExternal ? 'noopener noreferrer' : undefined}
key={link.link} key={link.link}
className="group flex items-center gap-3 px-4 py-2.5 text-gray-400 transition-colors hover:bg-slate-700" className={cn(
'group flex items-center gap-3 px-4 py-2.5 text-gray-400 transition-colors hover:bg-slate-700',
{
'mx-2 mb-1 rounded-md border border-slate-600 bg-slate-700 pl-2.5 text-gray-200 hover:bg-slate-600':
link.isHighlighted,
},
)}
role="menuitem" role="menuitem"
> >
<span className="flex h-[40px] w-[40px] items-center justify-center rounded-full bg-slate-600 transition-colors group-hover:bg-slate-500 group-hover:text-slate-100"> <span className="flex h-[40px] w-[40px] items-center justify-center rounded-full bg-slate-600 transition-colors group-hover:bg-slate-500 group-hover:text-slate-100">

@ -1,4 +1,4 @@
import { ChevronDown, Globe, Menu, Sparkles, Waypoints } from 'lucide-react'; import { ChevronDown, Globe, Menu, Sparkles, Map } from 'lucide-react';
import { useEffect, useRef, useState } from 'react'; import { useEffect, useRef, useState } from 'react';
import { useOutsideClick } from '../../hooks/use-outside-click'; import { useOutsideClick } from '../../hooks/use-outside-click';
import { cn } from '../../lib/classname'; import { cn } from '../../lib/classname';
@ -13,19 +13,22 @@ const links = [
link: '/roadmaps', link: '/roadmaps',
label: 'Official Roadmaps', label: 'Official Roadmaps',
description: 'Made by subject matter experts', description: 'Made by subject matter experts',
Icon: Waypoints, Icon: Map,
isHighlighted: true,
}, },
{ {
link: '/ai/explore', link: '/ai/explore',
label: 'AI Roadmaps', label: 'AI Roadmaps',
description: 'Generate roadmaps with AI', description: 'Generate roadmaps with AI',
Icon: Sparkles, Icon: Sparkles,
isHighlighted: false,
}, },
{ {
link: '/community', link: '/community',
label: 'Community Roadmaps', label: 'Community Roadmaps',
description: 'Made by community members', description: 'Made by community members',
Icon: Globe, Icon: Globe,
isHighlighted: false,
}, },
]; ];
@ -73,14 +76,34 @@ export function RoadmapDropdownMenu() {
<a <a
href={link.link} href={link.link}
key={link.link} key={link.link}
className="group flex items-center gap-3 px-4 py-2.5 text-gray-400 transition-colors hover:bg-slate-700" className={cn(
'group flex items-center gap-3 px-4 py-2.5 text-gray-400 transition-colors hover:bg-slate-700',
{
'mx-2 mb-1 rounded-md border border-slate-600 bg-slate-700 text-gray-200 hover:bg-slate-600':
link.isHighlighted,
},
)}
role="menuitem" role="menuitem"
> >
<span className="flex h-[40px] w-[40px] items-center justify-center rounded-full bg-slate-600 transition-colors group-hover:bg-slate-500 group-hover:text-slate-100"> <span
className={cn(
'flex h-[40px] w-[40px] items-center justify-center rounded-full bg-slate-600 transition-colors group-hover:bg-slate-500 group-hover:text-slate-100',
{
'bg-slate-500 text-slate-100': link.isHighlighted,
},
)}
>
<link.Icon className="inline-block h-5 w-5" /> <link.Icon className="inline-block h-5 w-5" />
</span> </span>
<span className="flex flex-col"> <span className="flex flex-col">
<span className="font-medium text-slate-300 transition-colors group-hover:text-slate-100"> <span
className={cn(
'font-medium text-slate-300 transition-colors group-hover:text-slate-100',
{
'text-white': link.isHighlighted,
},
)}
>
{link.label} {link.label}
</span> </span>
<span className="text-sm">{link.description}</span> <span className="text-sm">{link.description}</span>

Loading…
Cancel
Save