This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
181 additions
and
58 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from "react"; | ||
|
||
import { Navbar } from "../_components/navbar"; | ||
|
||
const LandingPageLayout = (props: { children: React.ReactNode }) => { | ||
return ( | ||
<> | ||
<Navbar /> | ||
<main className="container">{props.children}</main> | ||
</> | ||
); | ||
}; | ||
|
||
export default LandingPageLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,3 @@ | ||
import { Suspense } from "react"; | ||
|
||
import { api, HydrateClient } from "~/trpc/server"; | ||
import { AuthShowcase } from "../_components/auth-showcase"; | ||
import { | ||
CreatePostForm, | ||
PostCardSkeleton, | ||
PostList, | ||
} from "../_components/posts"; | ||
|
||
export const runtime = "edge"; | ||
|
||
export default function HomePage() { | ||
// You can await this here if you don't want to show Suspense fallback below | ||
void api.post.all.prefetch(); | ||
|
||
return ( | ||
<HydrateClient> | ||
<main className="container h-screen py-16"> | ||
<div className="flex flex-col items-center justify-center gap-4"> | ||
<h1 className="text-5xl font-extrabold tracking-tight sm:text-[5rem]"> | ||
Create <span className="text-primary">T3</span> Turbo | ||
</h1> | ||
<AuthShowcase /> | ||
|
||
<CreatePostForm /> | ||
<div className="w-full max-w-2xl overflow-y-scroll"> | ||
<Suspense | ||
fallback={ | ||
<div className="flex w-full flex-col gap-4"> | ||
<PostCardSkeleton /> | ||
<PostCardSkeleton /> | ||
<PostCardSkeleton /> | ||
</div> | ||
} | ||
> | ||
<PostList /> | ||
</Suspense> | ||
</div> | ||
</div> | ||
</main> | ||
</HydrateClient> | ||
); | ||
return <div>Hello, World!</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { usePathname } from "next/navigation"; | ||
import { useTheme } from "next-themes"; | ||
|
||
import { cn } from "@ubus/ui"; | ||
import { Button } from "@ubus/ui/button"; | ||
import { MenuIcon } from "@ubus/ui/icons"; | ||
|
||
const links: ILink[] = [ | ||
{ | ||
label: "Home", | ||
href: "/", | ||
}, | ||
{ | ||
label: "Features", | ||
href: "#features", | ||
}, | ||
{ | ||
label: "Testimonials", | ||
href: "#testimonials", | ||
}, | ||
{ | ||
label: "Contact", | ||
href: "#contact", | ||
}, | ||
]; | ||
|
||
export const Navbar = () => { | ||
const { theme } = useTheme(); | ||
const logoSrc = theme === "light" ? "ubus-dark.svg" : "ubus.svg"; | ||
|
||
return ( | ||
<nav className="border-outline"> | ||
<div className="mx-auto flex h-24 flex-wrap items-center justify-between"> | ||
<Link | ||
href="/" | ||
className="flex items-center space-x-3 rtl:space-x-reverse" | ||
> | ||
<Image | ||
src={logoSrc} | ||
width={32} | ||
height={24} | ||
className="h-8 w-6" | ||
alt="ubus logo" | ||
/> | ||
<span className="self-center whitespace-nowrap text-2xl font-semibold dark:text-white"> | ||
UBus | ||
</span> | ||
</Link> | ||
<div className="flex space-x-3 md:order-2 md:space-x-3 rtl:space-x-reverse"> | ||
<NavLink link={{ href: "sign in", label: "Sign in" }} /> | ||
<Button variant={"primary"}>Get started</Button> | ||
<Button className="md:hidden"> | ||
<span className="sr-only">Open main menu</span> | ||
<MenuIcon /> | ||
</Button> | ||
</div> | ||
<div className="hidden w-full items-center justify-between md:order-1 md:flex md:w-auto"> | ||
<ul className="mt-4 flex flex-col rounded-lg p-4 font-medium md:mt-0 md:flex-row md:space-x-8 md:p-0 rtl:space-x-reverse"> | ||
{links.map((link) => ( | ||
<li key={link.href}> | ||
<NavLink link={link} /> | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
); | ||
}; | ||
|
||
export const NavLink = ({ link }: { link: ILink }) => { | ||
const pathname = usePathname(); | ||
return ( | ||
<> | ||
<Link href={link.href}> | ||
<Button | ||
className={cn( | ||
"px-0 text-on-surface hover:text-primary", | ||
pathname === link.href && "text-primary", | ||
)} | ||
variant={"link"} | ||
> | ||
{link.label} | ||
</Button> | ||
</Link> | ||
</> | ||
); | ||
}; | ||
|
||
interface ILink { | ||
href: string; | ||
label: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from "react"; | ||
|
||
import { cn } from "."; | ||
|
||
const MenuIcon = ({ | ||
className, | ||
...props | ||
}: { | ||
className?: React.HtmlHTMLAttributes<"svg">; | ||
props?: React.HtmlHTMLAttributes<"svg">; | ||
}) => ( | ||
<svg | ||
className={cn("h-5 w-5", className)} | ||
aria-hidden="true" | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 17 14" | ||
{...props} | ||
> | ||
<path | ||
stroke="currentColor" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="2" | ||
d="M1 1h15M1 7h15M1 13h15" | ||
/> | ||
</svg> | ||
); | ||
|
||
export { MenuIcon }; |