Skip to content

Commit

Permalink
code-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ritikesh committed Oct 5, 2023
1 parent 24ac70e commit 0190ba5
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 30 deletions.
7 changes: 0 additions & 7 deletions app/(batches)/batch/[[...batchID]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { allBatches } from "@/.contentlayer/generated";
import { DocsHeader } from "@/components/docs-header";
import { Mdx } from "@/components/markdown/mdx";
import {
Accordion,
AccordionItem,
AccordionContent,
AccordionTrigger,
} from "@/components/ui/accordion";
import { cn } from "@/lib/utils";
import { notFound } from "next/navigation";

type Props = {
Expand Down
7 changes: 5 additions & 2 deletions app/(batches)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { CommandMenu } from "@/components/command-menu";
import { Icons } from "@/components/icons";
import MainNav from "@/components/layout/main-nav";
import { DocsSidebarNav } from "@/components/layout/sidebar-nav";
import { navConfig } from "@/config/nav";
import { docsConfig } from "@/config/sidebar";
import Link from "next/link";

Expand All @@ -24,7 +23,11 @@ const CourseRootLayout = ({ children }: BatchRootLayoutProps) => {
<div className=" px-3 hidden md:flex">
<CommandMenu />
</div>
<Link href="https://github.com/FrontendFreaks" target="_blank" rel="noreferrer">
<Link
href="https://github.com/FrontendFreaks"
target="_blank"
rel="noreferrer"
>
<Icons.gitHub className="h-7 w-7" />
<span className="sr-only">GitHub</span>
</Link>
Expand Down
6 changes: 5 additions & 1 deletion app/(docs)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ const CourseRootLayout = ({ children }: BatchRootLayoutProps) => {
<div className=" px-3 hidden md:flex">
<CommandMenu />
</div>
<Link href="https://github.com/FrontendFreaks" target="_blank" rel="noreferrer">
<Link
href="https://github.com/FrontendFreaks"
target="_blank"
rel="noreferrer"
>
<Icons.gitHub className="h-7 w-7" />
<span className="sr-only">GitHub</span>
</Link>
Expand Down
1 change: 0 additions & 1 deletion app/(marketing)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Faq } from "@/components/faq";
import Tracks from "@/components/tracks";
import { Button, buttonVariants } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { cn } from "@/lib/utils";
import Image from "next/image";
import Link from "next/link";
Expand Down
2 changes: 1 addition & 1 deletion components/layout/docs-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function DocSideNav({ items }: DocsSidebarNavProps) {
<div className="dark:text-gray-400">
{item.items ? (
<DocsSidebarNavItems items={item.items} pathname={pathname} />
) : null}
) : null}
</div>
</div>
))}
Expand Down
34 changes: 17 additions & 17 deletions components/layout/sidebar-nav.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
"use client"
"use client";

import Link from "next/link"
import { usePathname } from "next/navigation"
import Link from "next/link";
import { usePathname } from "next/navigation";

import { cn } from "@/lib/utils"
import { NavItem, SidebarNav, SidebarNavItem } from "@/types"
import { cn } from "@/lib/utils";
import { NavItem, SidebarNav, SidebarNavItem } from "@/types";
import {
Accordion,
AccordionContent,
AccordionItem,
AccordionTrigger,
} from "../ui/accordion"
} from "../ui/accordion";

export interface DocsSidebarNavProps {
items: SidebarNav[]
items: SidebarNav[];
}

export function DocsSidebarNav({ items }: DocsSidebarNavProps) {
const pathname = usePathname()
const pathname = usePathname();

return items.length ? (
<div className="w-full text-slate-800 ">
Expand All @@ -33,7 +33,7 @@ export function DocsSidebarNav({ items }: DocsSidebarNavProps) {
<AccordionContent>
{item.items ? (
<div className="dark:text-gray-400">
{item.items.map(item => (
{item.items.map((item) => (
<>
{item.href ? (
<DocsSidebarNavItem item={item} pathname={pathname} />
Expand Down Expand Up @@ -68,12 +68,12 @@ export function DocsSidebarNav({ items }: DocsSidebarNavProps) {
</div>
))}
</div>
) : null
) : null;
}

interface DocsSidebarNavItemsProps {
items: NavItem[] | undefined
pathname: string | null
items: NavItem[] | undefined;
pathname: string | null;
}

export function DocsSidebarNavItems({
Expand All @@ -85,15 +85,15 @@ export function DocsSidebarNavItems({
{items.map((item, index) => {
return (
<DocsSidebarNavItem key={index} item={item} pathname={pathname} />
)
);
})}
</div>
) : null
) : null;
}

interface DocsSidebarNavItemsrops {
item: NavItem | SidebarNavItem
pathname: string | null
item: NavItem | SidebarNavItem;
pathname: string | null;
}

export function DocsSidebarNavItem({
Expand All @@ -113,5 +113,5 @@ export function DocsSidebarNavItem({
<span className="flex w-full cursor-not-allowed items-center rounded-md p-2 opacity-60">
{item.title}
</span>
)
);
}
4 changes: 3 additions & 1 deletion components/layout/site-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default function SiteHeader({}: Props) {
<MainNav items={navConfig} />
<ModeToggle />
<a href="https://discord.com/invite/vee94km4Wh" target="_blank">
<Button className="hidden md:inline-block rounded-full">Mentorship</Button>
<Button className="hidden md:inline-block rounded-full">
Mentorship
</Button>
</a>
</div>
</header>
Expand Down

0 comments on commit 0190ba5

Please sign in to comment.