-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
'popover.tsx' and 'navbar.tsx' have been added to the UI. The 'compon…
…ents.json' file has also been created. Various pages have been updated, including 'page.tsx' and 'dashboard/page.tsx'. User interaction with the app has been improved through updates to 'useUserLoggedIn.ts' and 'utils.ts'. The new module 'tailwindcss-animate' has been added to the 'tailwind.config.ts' file.
- Loading branch information
Showing
15 changed files
with
768 additions
and
129 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 |
---|---|---|
|
@@ -61,3 +61,4 @@ desktop.ini | |
coverage/ | ||
/apps/js-examples/data | ||
/.42c | ||
/apps/next/ |
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,76 @@ | ||
export default async function Dashboard() { | ||
return ( | ||
<main className="flex min-h-screen flex-col items-center justify-between p-24"> | ||
|
||
<div className="mb-32 grid text-center lg:max-w-5xl lg:w-full lg:mb-0 lg:grid-cols-4 lg:text-left"> | ||
<a | ||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" | ||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2 className={`mb-3 text-2xl font-semibold`}> | ||
Docs{' '} | ||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none"> | ||
-> | ||
</span> | ||
</h2> | ||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}> | ||
Find in-depth information about Next.js features and API. | ||
</p> | ||
</a> | ||
|
||
<a | ||
href="/signin" | ||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2 className={`mb-3 text-2xl font-semibold`}> | ||
Sign In{' '} | ||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none"> | ||
-> | ||
</span> | ||
</h2> | ||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}> | ||
Learn about Next.js in an interactive course with quizzes! | ||
</p> | ||
</a> | ||
|
||
<a | ||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" | ||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2 className={`mb-3 text-2xl font-semibold`}> | ||
Templates{' '} | ||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none"> | ||
-> | ||
</span> | ||
</h2> | ||
<p className={`m-0 max-w-[30ch] text-sm opacity-50`}> | ||
Explore starter templates for Next.js. | ||
</p> | ||
</a> | ||
|
||
<a | ||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app" | ||
className="group rounded-lg border border-transparent px-5 py-4 transition-colors hover:border-gray-300 hover:bg-gray-100 hover:dark:border-neutral-700 hover:dark:bg-neutral-800/30" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2 className={`mb-3 text-2xl font-semibold`}> | ||
Deploy{' '} | ||
<span className="inline-block transition-transform group-hover:translate-x-1 motion-reduce:transform-none"> | ||
-> | ||
</span> | ||
</h2> | ||
<p className={`m-0 max-w-[30ch] text-sm opacity-50 text-balance`}> | ||
Instantly deploy your Next.js site to a shareable URL with Vercel. | ||
</p> | ||
</a> | ||
</div> | ||
</main> | ||
); | ||
} |
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,16 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "default", | ||
"rsc": true, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.ts", | ||
"css": "app/globals.css", | ||
"baseColor": "gray", | ||
"cssVariables": false | ||
}, | ||
"aliases": { | ||
"utils": "@/lib/utils", | ||
"components": "@/components" | ||
} | ||
} |
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,133 @@ | ||
// UserMenu.tsx | ||
import React from 'react'; | ||
import { Popover, PopoverTrigger, PopoverContent } from "@/components/ui/popover"; | ||
import { Button } from "@/components/ui/button"; | ||
import Link from "next/link"; | ||
import { User } from 'next-auth'; | ||
export const UserMenu = ({user}: {user: User}) => { | ||
return ( | ||
<Popover> | ||
<PopoverTrigger asChild> | ||
<Button className="rounded-full w-8 h-8 border-2 border-gray-100" size="icon" variant="ghost"> | ||
<img | ||
alt="Avatar" | ||
className="rounded-full" | ||
height="32" | ||
src={user.image || "/placeholder.svg"} | ||
style={{ | ||
aspectRatio: "32/32", | ||
objectFit: "cover", | ||
}} | ||
width="32" | ||
/> | ||
<span className="sr-only">Toggle user menu</span> | ||
</Button> | ||
</PopoverTrigger> | ||
<PopoverContent className="mt-1 w-56"> | ||
<div> | ||
<Link | ||
className="group flex items-center w-full px-3 py-1.5 text-sm rounded-md transition-colors hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-50" | ||
href="#" | ||
> | ||
<UserIcon className="w-4 h-4 mr-2" /> | ||
Your Profile | ||
</Link> | ||
</div> | ||
<div> | ||
<Link | ||
className="group flex items-center w-full px-3 py-1.5 text-sm rounded-md transition-colors hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-50" | ||
href="#" | ||
> | ||
<CogIcon className="w-4 h-4 mr-2" /> | ||
Settings | ||
</Link> | ||
</div> | ||
<div /> | ||
<div> | ||
<Link | ||
className="group flex items-center w-full px-3 py-1.5 text-sm rounded-md transition-colors hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-50" | ||
href="/logout" | ||
> | ||
<LogOutIcon className="w-4 h-4 mr-2" /> | ||
Logout | ||
</Link> | ||
</div> | ||
</PopoverContent> | ||
</Popover> | ||
); | ||
}; | ||
|
||
function UserIcon(props) { | ||
return ( | ||
<svg | ||
{...props} | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeWidth="2" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
> | ||
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" /> | ||
<circle cx="12" cy="7" r="4" /> | ||
</svg> | ||
) | ||
} | ||
|
||
|
||
function CogIcon(props) { | ||
return ( | ||
<svg | ||
{...props} | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeWidth="2" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
> | ||
<path d="M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z" /> | ||
<path d="M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" /> | ||
<path d="M12 2v2" /> | ||
<path d="M12 22v-2" /> | ||
<path d="m17 20.66-1-1.73" /> | ||
<path d="M11 10.27 7 3.34" /> | ||
<path d="m20.66 17-1.73-1" /> | ||
<path d="m3.34 7 1.73 1" /> | ||
<path d="M14 12h8" /> | ||
<path d="M2 12h2" /> | ||
<path d="m20.66 7-1.73 1" /> | ||
<path d="m3.34 17 1.73-1" /> | ||
<path d="m17 3.34-1 1.73" /> | ||
<path d="m11 13.73-4 6.93" /> | ||
</svg> | ||
) | ||
} | ||
|
||
|
||
function LogOutIcon(props) { | ||
return ( | ||
<svg | ||
{...props} | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeWidth="2" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
> | ||
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" /> | ||
<polyline points="16 17 21 12 16 7" /> | ||
<line x1="21" x2="9" y1="12" y2="12" /> | ||
</svg> | ||
) | ||
} |
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,68 @@ | ||
/** | ||
* This code was generated by v0 by Vercel. | ||
* @see https://v0.dev/t/nt6swWQ68T5 | ||
*/ | ||
import Link from "next/link" | ||
import { UserMenu } from './UserMenu'; | ||
import { User } from 'next-auth'; | ||
|
||
export function Navbar({user}: {user?: User}) { | ||
|
||
return ( | ||
<header className="flex items-center h-14 px-4 border-b gap-4 lg:px-6"> | ||
<Link className="flex items-center gap-2" href="#"> | ||
<PackageIcon className="w-6 h-6" /> | ||
<span className="font-semibold">FDAi Next.js Example</span> | ||
</Link> | ||
<nav className="flex flex-1 items-center justify-center space-x-4 lg:space-x-4"> | ||
<Link className="font-medium underline hover:no-underline" href="#"> | ||
Pricing | ||
</Link> | ||
<Link className="font-medium underline hover:no-underline" href="#"> | ||
Features | ||
</Link> | ||
<Link className="font-medium underline hover:no-underline" href="#"> | ||
Contact | ||
</Link> | ||
<Link className="font-medium underline hover:no-underline" href="#"> | ||
About | ||
</Link> | ||
<Link className="font-medium underline hover:no-underline" href="#"> | ||
Blog | ||
</Link> | ||
<Link className="font-medium underline hover:no-underline" href="#"> | ||
Resources | ||
</Link> | ||
<Link className="font-medium underline hover:no-underline" href="#"> | ||
Docs | ||
</Link> | ||
</nav> | ||
{user && <UserMenu user={user} />} | ||
</header> | ||
) | ||
} | ||
|
||
|
||
function PackageIcon(props) { | ||
return ( | ||
<svg | ||
{...props} | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeWidth="2" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
> | ||
<path d="m7.5 4.27 9 5.15" /> | ||
<path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z" /> | ||
<path d="m3.3 7 8.7 5 8.7-5" /> | ||
<path d="M12 22V12" /> | ||
</svg> | ||
) | ||
} | ||
|
||
|
Oops, something went wrong.