put navabr into layout, make basic docs sidebar
This commit is contained in:
parent
e6b7dc7cb9
commit
ed8ccd0e2f
6 changed files with 63 additions and 27 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -34,3 +34,6 @@ yarn-error.log*
|
|||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
|
||||
#bun
|
||||
bun.lockb
|
||||
|
|
9
app/docs/page.tsx
Normal file
9
app/docs/page.tsx
Normal file
|
@ -0,0 +1,9 @@
|
|||
import Sidebar from '@/components/shared/Sidebar';
|
||||
|
||||
export default function Page() {
|
||||
return (
|
||||
<>
|
||||
<Sidebar />
|
||||
</>
|
||||
);
|
||||
}
|
|
@ -1,16 +1,17 @@
|
|||
import type { Metadata } from "next";
|
||||
import { Poppins } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { ThemeProvider } from "@/components/shared/providers/themeprovider";
|
||||
import type { Metadata } from 'next';
|
||||
import { Poppins } from 'next/font/google';
|
||||
import './globals.css';
|
||||
import { ThemeProvider } from '@/components/shared/providers/themeprovider';
|
||||
import Navbar from '@/components/shared/Navbar';
|
||||
|
||||
const poppins = Poppins({
|
||||
weight: ["400", "600", "700", "900"],
|
||||
subsets: ["latin"],
|
||||
weight: ['400', '600', '700', '900'],
|
||||
subsets: ['latin'],
|
||||
});
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "SVRJS - A Web Server running on Nodejs",
|
||||
description: "Open Source Software Library",
|
||||
title: 'SVRJS - A Web Server running on Nodejs',
|
||||
description: 'Open Source Software Library',
|
||||
};
|
||||
|
||||
export default function RootLayout({
|
||||
|
@ -27,6 +28,7 @@ export default function RootLayout({
|
|||
enableSystem
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<Navbar />
|
||||
{children}
|
||||
</ThemeProvider>
|
||||
</body>
|
||||
|
|
10
app/page.tsx
10
app/page.tsx
|
@ -1,13 +1,11 @@
|
|||
import About from "@/components/shared/About";
|
||||
import Hero from "@/components/shared/Hero";
|
||||
import HowItWorks from "@/components/shared/HowItWorks";
|
||||
import Navbar from "@/components/shared/Navbar";
|
||||
import Newsletter from "@/components/shared/Newsletter";
|
||||
import About from '@/components/shared/About';
|
||||
import Hero from '@/components/shared/Hero';
|
||||
import HowItWorks from '@/components/shared/HowItWorks';
|
||||
import Newsletter from '@/components/shared/Newsletter';
|
||||
|
||||
const RootPage = () => {
|
||||
return (
|
||||
<>
|
||||
<Navbar />
|
||||
<Hero />
|
||||
<HowItWorks />
|
||||
<About />
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
"use client";
|
||||
'use client';
|
||||
|
||||
import {
|
||||
NavigationMenu,
|
||||
NavigationMenuItem,
|
||||
NavigationMenuList,
|
||||
} from "@radix-ui/react-navigation-menu";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import ThemeToggle from "../ui/theme-toggle";
|
||||
import { NAVBAR } from "@/constants";
|
||||
import { buttonVariants } from "../ui/button";
|
||||
import MobileNav from "./MobileNav";
|
||||
import { usePathname } from "next/navigation";
|
||||
} from '@radix-ui/react-navigation-menu';
|
||||
import Image from 'next/image';
|
||||
import Link from 'next/link';
|
||||
import ThemeToggle from '../ui/theme-toggle';
|
||||
import { NAVBAR } from '@/constants';
|
||||
import { buttonVariants } from '../ui/button';
|
||||
import MobileNav from './MobileNav';
|
||||
import { usePathname } from 'next/navigation';
|
||||
|
||||
const Navbar = () => {
|
||||
const pathname = usePathname();
|
||||
|
@ -50,9 +50,9 @@ const Navbar = () => {
|
|||
href={href}
|
||||
target={target}
|
||||
className={`text-[18px] tracking-tight ${
|
||||
pathname == href ? "bg-accent/40" : ""
|
||||
pathname == href ? 'bg-accent/40' : ''
|
||||
} ${buttonVariants({
|
||||
variant: "ghost",
|
||||
variant: 'ghost',
|
||||
})}`}
|
||||
>
|
||||
{label}
|
||||
|
@ -61,12 +61,12 @@ const Navbar = () => {
|
|||
</nav>
|
||||
|
||||
<div className="hidden md:flex gap-2 items-center">
|
||||
{NAVBAR.rightLinks?.map(({ href = "", label, target }) => (
|
||||
{NAVBAR.rightLinks?.map(({ href = '', label, target }) => (
|
||||
<Link
|
||||
key={label}
|
||||
href={href}
|
||||
target={target}
|
||||
className={`border ${buttonVariants({ variant: "ghost" })}`}
|
||||
className={`border ${buttonVariants({ variant: 'ghost' })}`}
|
||||
>
|
||||
<Image
|
||||
src="/next.svg"
|
||||
|
|
24
components/shared/Sidebar.tsx
Normal file
24
components/shared/Sidebar.tsx
Normal file
|
@ -0,0 +1,24 @@
|
|||
import React from 'react';
|
||||
|
||||
const Sidebar = () => {
|
||||
return (
|
||||
<div className="w-[250px] h-[100vh] border-r dark:border-r-slate-800 pl-4 pt-2">
|
||||
<span className="flex flex-col gap-2">
|
||||
<h2 className="text-2xl font-bold">First use</h2>
|
||||
<ul className="pl-4 flex flex-col gap-2">
|
||||
<li>System requirements</li>
|
||||
<li>Installation</li>
|
||||
<li>Features</li>
|
||||
<li>SVR.JS files</li>
|
||||
<li>SVR.JS utilities</li>
|
||||
<li>SVR.JS commands</li>
|
||||
<li>Updating SVR.JS</li>
|
||||
<li>Common problems</li>
|
||||
<li>Bun support</li>
|
||||
</ul>
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Sidebar;
|
Loading…
Reference in a new issue