-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from FleetAdmiralJakob/refactor-navbar
- Loading branch information
Showing
11 changed files
with
142 additions
and
133 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
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,23 @@ | ||
import { AddUserDialog } from "~/components/homepage/add-user-dialog"; | ||
import Chats from "~/components/homepage/chat-overview"; | ||
import { SignOutButton } from "@clerk/nextjs"; | ||
import { currentUser } from "@clerk/nextjs/server"; | ||
import { redirect } from "next/navigation"; | ||
|
||
export default async function ChatOverwiewPage() { | ||
const user = await currentUser(); | ||
if (!user) redirect("/"); | ||
return ( | ||
<div className="pb-24 lg:ml-24"> | ||
<div className="relative flex h-full w-full justify-center"> | ||
<h1 className="pt-28 text-4xl font-bold">Chats</h1> | ||
<AddUserDialog classNameDialogTrigger="absolute bg-input right-16 top-16" /> | ||
</div> | ||
<p className="absolute top-0"> | ||
Current User: {user.username} <br /> <SignOutButton /> | ||
</p>{" "} | ||
<br /> | ||
<Chats /> | ||
</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,10 @@ | ||
import Navbar from "~/components/navbar"; | ||
|
||
export default function Layout({ children }: { children: React.ReactNode }) { | ||
return ( | ||
<div className="min-h-screen"> | ||
{children} | ||
<Navbar /> | ||
</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,76 @@ | ||
import { Avatar, AvatarFallback } from "~/components/ui/avatar"; | ||
import { Lock, NotebookText } from "lucide-react"; | ||
|
||
import { Bell } from "lucide-react"; | ||
import Link from "next/link"; | ||
import { SendHorizontal } from "lucide-react"; | ||
import { Settings } from "lucide-react"; | ||
import { UsersRound } from "lucide-react"; | ||
import { currentUser } from "@clerk/nextjs/server"; | ||
|
||
interface settingsCard { | ||
title: string; | ||
icon: JSX.Element; | ||
} | ||
|
||
const settings: settingsCard[] = [ | ||
{ title: "Account", icon: <Lock /> }, | ||
{ title: "Chats", icon: <SendHorizontal /> }, | ||
{ title: "Notification", icon: <Bell /> }, | ||
{ title: "Settings", icon: <Settings /> }, | ||
{ title: "Contributors", icon: <UsersRound /> }, | ||
]; | ||
|
||
export default async function Profile() { | ||
const user = await currentUser(); | ||
const username = user?.username; | ||
|
||
return ( | ||
<div className=" flex h-full flex-col items-center justify-around lg:pl-24"> | ||
<div className="flex flex-col items-center"> | ||
<p className=" my-10 mt-16 text-xl font-bold sm:text-2xl xl:hidden"> | ||
Profile | ||
</p> | ||
|
||
<div className="flex xl:mt-14"> | ||
<div className="text-sm"> | ||
<Avatar className="h-12 w-12 text-white "> | ||
<AvatarFallback> | ||
{username ? username.substring(0, 2).toUpperCase() : "Y"} | ||
</AvatarFallback> | ||
</Avatar> | ||
</div> | ||
<div | ||
className="ml-4 text-sm | ||
xl:mt-2 xl:text-lg" | ||
> | ||
{user?.lastName && user.firstName ? ( | ||
<div> | ||
{user.firstName} {user?.lastName} / <br className="xl:hidden" />{" "} | ||
{user.username} | ||
</div> | ||
) : ( | ||
<div className="xl:mt-4">{user?.username}</div> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
<div className="mb-20 mt-10 w-full pb-24 sm:mb-32 lg:w-2/3 xl:w-1/3"> | ||
{settings.map((item) => { | ||
return ( | ||
<Link | ||
key={item.title} | ||
href={`/profile/${item.title.toLowerCase()}`} | ||
className="flex w-full cursor-pointer border-t-2 border-input p-7 text-xl sm:text-2xl lg:mt-6 lg:rounded-xl lg:border-0 lg:bg-input xl:text-xl" | ||
> | ||
<p className="mr-5 rounded-3xl bg-accent p-3 text-white"> | ||
{item.icon} | ||
</p> | ||
<p className="pt-3">{item.title}</p> | ||
</Link> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
); | ||
} |
6 changes: 1 addition & 5 deletions
6
src/app/profile/settings/page.tsx → ...internal-sites)/profile/settings/page.tsx
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,11 +1,7 @@ | ||
import Navbar from "~/components/navbar"; | ||
|
||
const SettingsPage = () => { | ||
return ( | ||
<div> | ||
<Navbar /> | ||
</div> | ||
); | ||
return <div>Settings</div>; | ||
}; | ||
|
||
export default SettingsPage; |
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,11 @@ | ||
import Navbar from "~/components/navbar"; | ||
|
||
const Todo = () => { | ||
return ( | ||
<div className="flex h-full flex-col items-center justify-center lg:pl-24"> | ||
<p>Todo</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Todo; |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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