Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Add separate cohort 2 and cohort 3 assignment Links #1375

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 44 additions & 21 deletions src/components/profile-menu/ExternalLinks.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,56 @@
import { SiGithub, SiNotion } from '@icons-pack/react-simple-icons';
import Link from 'next/link';
import React from 'react';
import { DropdownMenuItem } from '../ui/dropdown-menu';
import { ArrowUpRightFromSquare } from 'lucide-react';
import {
DropdownMenuItem,
DropdownMenuSub,
DropdownMenuSubContent,
DropdownMenuSubTrigger,
} from '@/components/ui/dropdown-menu';

const ExternalLinks = () => {
const externalLinks = [
export default function ExternalLinks() {
const assignmentLinks = [
{
href: 'https://github.com/100xdevs-cohort-2/assignments',
label: 'Assignments',
icon: <SiGithub className="h-4 w-4" />,
label: 'Cohort 2',
},
{
href: 'https://projects.100xdevs.com/',
label: 'Slides',
icon: <SiNotion className="h-4 w-4" />,
href: 'https://github.com/100xdevs-cohort-3/assignments',
label: 'Cohort 3',
},
];
return externalLinks.map((link) => (
<Link key={link.href} href={link.href} target="_blank">
<DropdownMenuItem className="flex items-center justify-between text-base">
<div className="flex items-center gap-2">
{link.icon}
<span>{link.label}</span>
</div>
<ArrowUpRightFromSquare className="size-4" />
</DropdownMenuItem>
</Link>
));
};

export default ExternalLinks;
return (
<>
<DropdownMenuSub>
<DropdownMenuSubTrigger className="flex items-center justify-between text-base">
<div className="flex items-center gap-2">
<SiGithub className="h-4 w-4" />
<span>Assignments</span>
</div>
</DropdownMenuSubTrigger>
<DropdownMenuSubContent className="bg-neutral-100 dark:bg-neutral-900">
{assignmentLinks.map((link) => (
<Link key={link.href} href={link.href} target="_blank">
<DropdownMenuItem className="flex items-center justify-between text-base">
<span>{link.label}</span>
<ArrowUpRightFromSquare className="h-4 w-4" />
</DropdownMenuItem>
</Link>
))}
</DropdownMenuSubContent>
</DropdownMenuSub>

<Link href="https://projects.100xdevs.com/" target="_blank">
<DropdownMenuItem className="flex items-center justify-between text-base">
<div className="flex items-center gap-2">
<SiNotion className="h-4 w-4" />
<span>Slides</span>
</div>
<ArrowUpRightFromSquare className="h-4 w-4" />
</DropdownMenuItem>
</Link>
</>
);
}
Loading