-
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.
- Loading branch information
Showing
16 changed files
with
1,085 additions
and
1,096 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,5 @@ | ||
import Container from '.' | ||
|
||
export default function CardContainer({ children }: { children?: React.ReactNode }) { | ||
return <Container className="mt-24 max-w-md">{children}</Container> | ||
} |
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,9 @@ | ||
import { cn } from "~/lib/utils" | ||
|
||
export default function Container({ className, children }: { className?: string, children?: React.ReactNode }) { | ||
return ( | ||
<div className={cn("w-full container mx-auto px-8", className)}> | ||
{children} | ||
</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 React from "react"; | ||
import { cn } from "~/lib/utils"; | ||
|
||
export default function Hero({ className, children }: { className?: string, children?: React.ReactNode }) { | ||
return ( | ||
<div className={cn("h-screen overflow-y-clip relative flex-non", className)}> | ||
{children} | ||
</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,81 @@ | ||
import { useForm } from '@inertiajs/react' | ||
import { Link } from '@tuyau/inertia/react' | ||
import { Button, buttonVariants } from '~/components/ui/button' | ||
import { useAuth } from '~/hooks/use_auth' | ||
import { useTuyau } from '~/hooks/use_tuyau' | ||
import { cn } from '~/lib/utils' | ||
import Container from './containers' | ||
|
||
/* | ||
import { Menu } from "lucide-react"; | ||
import { | ||
NavigationMenu, | ||
NavigationMenuItem, | ||
NavigationMenuLink, | ||
NavigationMenuList, | ||
} from "./ui/navigation-menu"; | ||
import { | ||
DropdownMenu, | ||
DropdownMenuContent, | ||
DropdownMenuGroup, | ||
DropdownMenuItem, | ||
DropdownMenuSeparator, | ||
DropdownMenuTrigger, | ||
} from "./ui/dropdown-menu"; | ||
import { Button } from "./ui/button"; | ||
type PageRoute = { | ||
href: string; | ||
title: string; | ||
}; | ||
*/ | ||
|
||
function LoginButton() { | ||
return ( | ||
<Link route="pages:auth.login" className={buttonVariants({ variant: 'secondary' })}> | ||
Login | ||
</Link> | ||
) | ||
} | ||
|
||
function LogoutButton() { | ||
const tuyau = useTuyau() | ||
const { post } = useForm() | ||
|
||
function onSubmit(e: React.FormEvent<HTMLFormElement>) { | ||
e.preventDefault() | ||
post(tuyau.$url('actions:auth.logout')) | ||
} | ||
|
||
return ( | ||
<form onSubmit={onSubmit} method="post"> | ||
<Button type="submit" variant="secondary"> | ||
Logout | ||
</Button> | ||
</form> | ||
) | ||
} | ||
|
||
export function Navbar({ className }: { className?: string }) { | ||
const auth = useAuth() | ||
|
||
return ( | ||
<nav className={cn('w-full', className)}> | ||
<Container> | ||
<div className="w-full py-6 flex flex-row justify-between items-center"> | ||
<Link route="pages:home"> | ||
<img className="w-20 md:w-28 h-auto" src="/images/logo-white.svg" alt="Logótipo do ENEI" /> | ||
<span className='sr-only'>Ir para a página inicial</span> | ||
</Link> | ||
{auth.state === 'authenticated' ? ( | ||
<LogoutButton /> | ||
) : ( | ||
auth.state === 'unauthenticated' && <LoginButton /> | ||
)} | ||
</div> | ||
</Container> | ||
</nav> | ||
) | ||
} |
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 { Head } from '@inertiajs/react' | ||
import React from 'react' | ||
import { cn } from '~/lib/utils' | ||
import { Navbar } from './navbar' | ||
|
||
export default function Page({ | ||
title, | ||
className, | ||
children, | ||
}: { | ||
title: string | ||
className?: string | ||
children?: React.ReactNode | ||
}) { | ||
return ( | ||
<div className={cn('w-full min-h-dvh scroll-smooth relative flex flex-col', className)}> | ||
<Head title={title} /> | ||
<Navbar className="sticky top-0 z-10 grow-0" /> | ||
|
||
{children} | ||
</div> | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.