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
20 changed files
with
136 additions
and
97 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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
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,31 @@ | ||
"use server"; | ||
|
||
import { IconLogout } from "@tabler/icons-react"; | ||
|
||
import type { ButtonProps } from "@ubus/ui/button"; | ||
import { signOut } from "@ubus/auth"; | ||
import { Button } from "@ubus/ui/button"; | ||
|
||
interface LogoutButtonProps extends ButtonProps { | ||
withIcon?: boolean; | ||
} | ||
|
||
export const LogoutButton = ({ | ||
withIcon = true, | ||
...props | ||
}: LogoutButtonProps) => { | ||
return ( | ||
<form className="contents"> | ||
<Button | ||
{...props} | ||
formAction={async () => { | ||
"use server"; | ||
await signOut(); | ||
}} | ||
> | ||
{withIcon && <IconLogout className="mr-2" />} | ||
Log out | ||
</Button> | ||
</form> | ||
); | ||
}; |
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,29 @@ | ||
import { landingNavLinks } from "@ubus/configs"; | ||
|
||
import { LogoutButton } from "./logout-button"; | ||
import { NavLink } from "./navlink"; | ||
import { UserAvatar } from "./user-avatar"; | ||
|
||
export const DashboardNavbar = () => { | ||
return ( | ||
<div className="container flex h-20 w-full justify-between"> | ||
UBus | ||
<UserAvatar /> | ||
<LogoutButton /> | ||
</div> | ||
); | ||
}; | ||
|
||
export const LandingNavbar = () => { | ||
return ( | ||
<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:gap-8 md:p-0"> | ||
{landingNavLinks.map((link) => ( | ||
<li key={link.href}> | ||
<NavLink className="px-0" link={link} /> | ||
</li> | ||
))} | ||
</ul> | ||
</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
File renamed without changes.
File renamed without changes.
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 { cn } from "@ubus/ui"; | ||
import { Avatar, AvatarFallback, AvatarImage } from "@ubus/ui/avatar"; | ||
import { Label } from "@ubus/ui/label"; | ||
|
||
interface IUserAvatarProps { | ||
className?: string; | ||
} | ||
export const UserAvatar = ({ className }: IUserAvatarProps) => { | ||
return ( | ||
<div | ||
className={cn( | ||
"flex h-fit flex-nowrap items-center justify-center", | ||
className, | ||
)} | ||
> | ||
<Label>User Name</Label> | ||
<Avatar> | ||
<AvatarFallback>UN</AvatarFallback> | ||
<AvatarImage src="" /> | ||
</Avatar> | ||
</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,7 @@ | ||
import { DashboardHeader } from "../_components/header"; | ||
|
||
const Dashboard = () => { | ||
return <DashboardHeader />; | ||
}; | ||
|
||
export default Dashboard; |
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,16 +1,24 @@ | ||
import { auth } from "@ubus/auth"; | ||
import { Contact } from "./_components/contact"; | ||
import { EssentialFeatures, KeyFeatures } from "./_components/features"; | ||
import { Footer } from "./_components/footer"; | ||
import { LandingHeader } from "./_components/header"; | ||
import { Hero } from "./_components/hero"; | ||
import { OurTeam } from "./_components/our-team"; | ||
import { Testimonials } from "./_components/testimonials"; | ||
|
||
import { Dashboard } from "./_components/dashboard"; | ||
import LandingPage from "./_components/landing-page"; | ||
|
||
const HomePage = async () => { | ||
const session = await auth(); | ||
|
||
if (!session) { | ||
return <LandingPage />; | ||
} | ||
|
||
return <Dashboard />; | ||
const HomePage = () => { | ||
return ( | ||
<> | ||
<LandingHeader /> | ||
<Hero /> | ||
<KeyFeatures /> | ||
<EssentialFeatures /> | ||
<Testimonials /> | ||
<OurTeam /> | ||
<Contact /> | ||
<Footer /> | ||
</> | ||
); | ||
}; | ||
|
||
export default HomePage; |
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