Skip to content

Commit

Permalink
[www]: (refactor): Update site header, Remove UI from packages, Rethi…
Browse files Browse the repository at this point in the history
…nk things
  • Loading branch information
alifarooq9 committed Apr 6, 2024
1 parent 8ec9aa5 commit 53be4cd
Show file tree
Hide file tree
Showing 40 changed files with 805 additions and 835 deletions.
17 changes: 17 additions & 0 deletions apps/www/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/styles/globals.css",
"baseColor": "zinc",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
109 changes: 58 additions & 51 deletions apps/www/package.json
Original file line number Diff line number Diff line change
@@ -1,53 +1,60 @@
{
"name": "www",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"build": "pnpm with-env next build",
"dev": "pnpm with-env next dev",
"lint": "next lint",
"start": "pnpm with-env next start --port=3001",
"with-env": "dotenv -e ../../.env --"
},
"dependencies": {
"@hookform/resolvers": "^3.3.4",
"@t3-oss/env-nextjs": "^0.9.2",
"@tanstack/react-query": "^5.24.1",
"@vercel/analytics": "^1.2.2",
"geist": "^1.2.2",
"lucide-react": "^0.343.0",
"next": "^14.1.0",
"next-themes": "^0.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.50.1",
"react-wrap-balancer": "^1.1.0",
"zod": "^3.22.4"
},
"devDependencies": {
"@rapidlaunch/db": "workspace:*",
"@rapidlaunch/eslint-config": "workspace:*",
"@rapidlaunch/tailwind-config": "workspace:*",
"@rapidlaunch/typescript-config": "workspace:*",
"@rapidlaunch/ui": "workspace:*",
"@types/eslint": "^8.56.2",
"@types/node": "^20.11.20",
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"dotenv-cli": "^7.3.0",
"eslint": "^8.56.0",
"eslint-config-next": "^14.1.0",
"postcss": "^8.4.34",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
},
"ct3aMetadata": {
"initVersion": "7.28.0"
},
"packageManager": "pnpm@8.15.2"
"name": "www",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"build": "pnpm with-env next build",
"dev": "pnpm with-env next dev",
"lint": "next lint",
"start": "pnpm with-env next start --port=3001",
"with-env": "dotenv -e ../../.env --"
},
"dependencies": {
"@hookform/resolvers": "^3.3.4",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-slot": "^1.0.2",
"@t3-oss/env-nextjs": "^0.9.2",
"@tanstack/react-query": "^5.24.1",
"@vercel/analytics": "^1.2.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"geist": "^1.2.2",
"lucide-react": "^0.343.0",
"next": "^14.1.0",
"next-themes": "^0.2.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hook-form": "^7.50.1",
"react-wrap-balancer": "^1.1.0",
"sonner": "^1.4.2",
"tailwind-merge": "^2.2.1",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.22.4"
},
"devDependencies": {
"@rapidlaunch/db": "workspace:*",
"@rapidlaunch/eslint-config": "workspace:*",
"@rapidlaunch/tailwind-config": "workspace:*",
"@rapidlaunch/typescript-config": "workspace:*",
"@types/eslint": "^8.56.2",
"@types/node": "^20.11.20",
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"dotenv-cli": "^7.3.0",
"eslint": "^8.56.0",
"eslint-config-next": "^14.1.0",
"postcss": "^8.4.34",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.11",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
},
"ct3aMetadata": {
"initVersion": "7.28.0"
},
"packageManager": "pnpm@8.15.2"
}
35 changes: 35 additions & 0 deletions apps/www/src/app/(app)/_components/main-nav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use client";

import { navConfig } from "@/config/nav";
import { usePathname } from "next/navigation";
import { cn } from "@/lib/utils";
import Link from "next/link";

export function MainNav() {
const pathname = usePathname();

return (
<section className="flex items-center gap-6">
<nav className="flex items-center gap-2">
<ul className="flex items-center gap-5">
{navConfig.items.map((item) => (
<li key={item.label}>
<Link
href={item.href}
className={cn(
" text-sm text-muted-foreground hover:text-foreground/80",
{
"text-foreground":
pathname === item.href,
},
)}
>
{item.label}
</Link>
</li>
))}
</ul>
</nav>
</section>
);
}
61 changes: 61 additions & 0 deletions apps/www/src/app/(app)/_components/side-header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { MainNav } from "@/app/(app)/_components/main-nav";
import { ThemeToggle } from "@/components/theme-toggle";
import { MoonIcon, SunIcon } from "lucide-react";
import { Button, buttonVariants } from "@/components/ui/button";
import { siteUrls } from "@/config/urls";
import Link from "next/link";
import { Icons } from "@/components/icons";

export function SiteHeader() {
return (
<header className="sticky top-0 w-full border-b border-border bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
<div className="container flex h-14 max-w-screen-2xl items-center justify-between">
<div className="flex items-center gap-5">
<Link href={siteUrls.home} className="left-4 z-10">
<Icons.logo
classNameText="hidden sm:block"
iconProps={{
className:
"w-6 h-6 sm:w-5 sm:h-5 fill-foreground",
}}
/>
</Link>

<MainNav />
</div>

<nav className="flex items-center gap-2">
<Link
href={siteUrls.twitter}
target="_blank"
className={buttonVariants({
variant: "outline",
size: "iconSm",
})}
>
<Icons.twitter className="h-4 w-4 fill-foreground" />
</Link>
<Link
href={siteUrls.github}
target="_blank"
className={buttonVariants({
variant: "outline",
size: "iconSm",
})}
>
<Icons.gitHub className="h-4 w-4 fill-foreground" />
</Link>
<ThemeToggle
button={
<Button variant="outline" size="iconSm">
<SunIcon className="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<MoonIcon className="absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<span className="sr-only">Toggle theme</span>
</Button>
}
/>
</nav>
</div>
</header>
);
}
14 changes: 14 additions & 0 deletions apps/www/src/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { SiteHeader } from "@/app/(app)/_components/side-header";

interface AppLayoutProps {
children: React.ReactNode;
}

export default function AppLayout({ children }: AppLayoutProps) {
return (
<>
<SiteHeader />
<main className="flex-1">{children}</main>
</>
);
}
4 changes: 2 additions & 2 deletions apps/www/src/app/page.tsx → apps/www/src/app/(app)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Badge } from "@rapidlaunch/ui/badge";
import { Badge } from "@/components/ui/badge";
import Balance from "react-wrap-balancer";
import { EarlyAccessForm } from "@/components/early-access-form";

export default function HomePage() {
return (
<main className="container flex flex-col items-center justify-center gap-4 py-20">
<Badge size="md" variant="secondary" className="gap-2">
<Badge variant="secondary" className="gap-2">
<span>🎉</span>{" "}
<p>Open Source SaaS Starterkits and components</p>
</Badge>
Expand Down
16 changes: 6 additions & 10 deletions apps/www/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import Background from "@/components/background";
import { Header } from "@/components/header";
import Providers from "@/components/providers";
import { Toaster } from "@rapidlaunch/ui/sonner";
import { Toaster } from "@/components/ui/sonner";
import "@/styles/globals.css";

import { GeistSans } from "geist/font/sans";
import type { Metadata } from "next";
import { siteConfig } from "@/config/site";
import { Analytics } from "@vercel/analytics/react";
import { fontSans } from "@/lib/fonts";

const TITLE =
"Rapidlaunch | Open Source Nextjs SaaS Starterkits and Components";
const DESCRIPTION =
"Launch your apps faster with our SaaS starterkits, components, building blocks. Customizable. Open Source";

export const metadata: Metadata = {
metadataBase: new URL("https://www.rapidlaunch.xyz"),
title: TITLE,
description: DESCRIPTION,
icons: [{ rel: "icon", url: "/favicon.ico" }],
Expand Down Expand Up @@ -50,13 +49,10 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body className={`${GeistSans.className}`}>
<body className={`${fontSans.className}`}>
<Providers>
<Background>
<Header />
{children}
<Toaster position="top-center" />
</Background>
{children}
<Toaster position="top-center" />
</Providers>
<Analytics />
</body>
Expand Down
48 changes: 0 additions & 48 deletions apps/www/src/components/background.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions apps/www/src/components/early-access-form.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
"use client";

import { Button } from "@rapidlaunch/ui/button";
import { Input } from "@rapidlaunch/ui/input";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import {
Form,
FormControl,
FormField,
FormItem,
FormMessage,
} from "@rapidlaunch/ui/form";
} from "@/components/ui/form";
import { z } from "zod";
import { zodResolver } from "@hookform/resolvers/zod";
import { useForm } from "react-hook-form";
import { useMutation } from "@tanstack/react-query";
import { joinEarlyAccessAction } from "@/server/actions";
import { Icons } from "@/components/icons";
import { toast } from "@rapidlaunch/ui/sonner";
import { toast } from "sonner";

const formSchema = z.object({
name: z.string().min(2, {
Expand Down
Loading

0 comments on commit 53be4cd

Please sign in to comment.