-
Notifications
You must be signed in to change notification settings - Fork 54
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
13 changed files
with
4,884 additions
and
1,284 deletions.
There are no files selected for viewing
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 @@ | ||
public-hoist-pattern[]=*@nextui-org/* |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,15 @@ | ||
import { Card, CardBody } from "@nextui-org/react"; | ||
import { IconFileUnknown } from "@tabler/icons-react"; | ||
|
||
export default function NotFound() { | ||
return ( | ||
<Card className="mx-auto mt-4 max-w-md"> | ||
<CardBody> | ||
<p className="flex items-center justify-center gap-2 text-2xl"> | ||
<IconFileUnknown /> | ||
This page cannot be found. | ||
</p> | ||
</CardBody> | ||
</Card> | ||
); | ||
} |
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,3 +1,12 @@ | ||
import { Card, CardBody } from "@nextui-org/react"; | ||
|
||
export default function Home() { | ||
return <h1>Hello World</h1>; | ||
return ( | ||
<Card className="mx-auto mt-4 max-w-md"> | ||
<CardBody className="text-center"> | ||
<h1 className="text-5xl">Next.js Starter</h1> | ||
<p className="text-xl">A simple starter for Next.js</p> | ||
</CardBody> | ||
</Card> | ||
); | ||
} |
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,72 @@ | ||
"use client"; | ||
|
||
import React from "react"; | ||
|
||
import { | ||
Link, | ||
Navbar, | ||
NavbarBrand, | ||
NavbarContent, | ||
NavbarItem, | ||
NavbarMenu, | ||
NavbarMenuItem, | ||
NavbarMenuToggle, | ||
} from "@nextui-org/react"; | ||
import { IconPackage } from "@tabler/icons-react"; | ||
|
||
import { ThemeSwitcher } from "./theme-switcher"; | ||
|
||
export default function AppNavbar() { | ||
const [isMenuOpen, setIsMenuOpen] = React.useState(false); | ||
|
||
const menuItems = [ | ||
{ | ||
label: "Home", | ||
href: "/", | ||
}, | ||
{ | ||
label: "Profile", | ||
href: "/profile", | ||
}, | ||
]; | ||
|
||
return ( | ||
<Navbar onMenuOpenChange={setIsMenuOpen}> | ||
<NavbarContent> | ||
<NavbarMenuToggle | ||
aria-label={isMenuOpen ? "Close menu" : "Open menu"} | ||
className="sm:hidden" | ||
/> | ||
<NavbarBrand> | ||
<IconPackage /> | ||
<p className="font-bold text-inherit">Next.js Starter</p> | ||
</NavbarBrand> | ||
</NavbarContent> | ||
|
||
<NavbarContent className="hidden gap-4 sm:flex" justify="center"> | ||
{menuItems.map((item, index) => ( | ||
<NavbarItem key={`${item}-${index}`}> | ||
<Link className="w-full" href={item.href} size="lg"> | ||
{item.label} | ||
</Link> | ||
</NavbarItem> | ||
))} | ||
<NavbarItem> | ||
<ThemeSwitcher /> | ||
</NavbarItem> | ||
</NavbarContent> | ||
<NavbarMenu> | ||
<NavbarMenuItem> | ||
<ThemeSwitcher showLabel /> | ||
</NavbarMenuItem> | ||
{menuItems.map((item, index) => ( | ||
<NavbarMenuItem key={`${item}-${index}`}> | ||
<Link className="w-full" href={item.href} size="lg"> | ||
{item.label} | ||
</Link> | ||
</NavbarMenuItem> | ||
))} | ||
</NavbarMenu> | ||
</Navbar> | ||
); | ||
} |
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,21 @@ | ||
"use client"; | ||
|
||
import { useRouter } from "next/navigation"; | ||
import { ReactNode } from "react"; | ||
|
||
import { NextUIProvider } from "@nextui-org/react"; | ||
import { ThemeProvider as NextThemesProvider } from "next-themes"; | ||
|
||
export default function Providers({ children }: { children: ReactNode }) { | ||
const router = useRouter(); | ||
return ( | ||
<NextUIProvider | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-expect-error | ||
navigate={router.push} | ||
className="flex h-full w-full flex-col" | ||
> | ||
<NextThemesProvider attribute="class">{children}</NextThemesProvider> | ||
</NextUIProvider> | ||
); | ||
} |
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,34 @@ | ||
"use client"; | ||
|
||
import { useEffect, useState } from "react"; | ||
|
||
import { Switch } from "@nextui-org/react"; | ||
import { IconMoon, IconSun } from "@tabler/icons-react"; | ||
|
||
import useSystemTheme from "@/hooks/use-system-theme"; | ||
|
||
export function ThemeSwitcher({ showLabel }: { showLabel?: boolean }) { | ||
const [mounted, setMounted] = useState(false); | ||
const { theme, setTheme } = useSystemTheme(); | ||
|
||
useEffect(() => { | ||
setMounted(true); | ||
}, []); | ||
|
||
if (!mounted) return null; | ||
|
||
return ( | ||
<Switch | ||
isSelected={theme === "light"} | ||
onValueChange={() => | ||
theme === "dark" ? setTheme("light") : setTheme("dark") | ||
} | ||
size="lg" | ||
color="success" | ||
startContent={<IconSun />} | ||
endContent={<IconMoon />} | ||
> | ||
{showLabel && "Theme"} | ||
</Switch> | ||
); | ||
} |
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,16 @@ | ||
import { Dispatch, SetStateAction, useMemo } from "react"; | ||
|
||
import { useTheme } from "next-themes"; | ||
|
||
type Theme = "dark" | "light"; | ||
type SetTheme = Dispatch<SetStateAction<Theme>>; | ||
|
||
export default function useSystemTheme() { | ||
const { theme, setTheme, systemTheme } = useTheme(); | ||
return useMemo(() => { | ||
return { | ||
theme: theme === "system" ? systemTheme : theme, | ||
setTheme, | ||
} as { theme: Theme; setTheme: SetTheme }; | ||
}, [theme, setTheme, systemTheme]); | ||
} |
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,19 +1,16 @@ | ||
import { nextui } from "@nextui-org/react"; | ||
import type { Config } from "tailwindcss"; | ||
|
||
const config: Config = { | ||
content: [ | ||
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./src/components/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./src/app/**/*.{js,ts,jsx,tsx,mdx}", | ||
"./node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}", | ||
], | ||
theme: { | ||
extend: { | ||
colors: { | ||
background: "var(--background)", | ||
foreground: "var(--foreground)", | ||
}, | ||
}, | ||
extend: {}, | ||
}, | ||
plugins: [], | ||
darkMode: "class", | ||
plugins: [nextui()], | ||
}; | ||
export default config; |