add
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
useSidebar
|
||||
} from '@repo/ui/components/ui/sidebar'
|
||||
import { initials } from '@repo/ui/lib/utils'
|
||||
import { Link } from 'react-router'
|
||||
|
||||
export type Workspace = {
|
||||
id: string
|
||||
@@ -69,6 +70,7 @@ export function WorkspaceProvider({
|
||||
|
||||
export function WorkspaceSwitcher() {
|
||||
const location = useLocation()
|
||||
const { orgid } = useParams()
|
||||
const { isMobile, state } = useSidebar()
|
||||
const { activeWorkspace, setActiveWorkspace, workspaces } = useWorksapce()
|
||||
const [, fragment, _] = location.pathname.slice(1).split('/')
|
||||
@@ -141,13 +143,15 @@ export function WorkspaceSwitcher() {
|
||||
|
||||
<DropdownMenuSeparator />
|
||||
|
||||
<DropdownMenuItem className="gap-2 p-2">
|
||||
<div className="flex size-6 items-center justify-center rounded-md border bg-transparent">
|
||||
<PlusIcon className="size-4" />
|
||||
</div>
|
||||
<div className="text-muted-foreground font-medium">
|
||||
Adicionar empresa
|
||||
</div>
|
||||
<DropdownMenuItem className="gap-2 p-2 cursor-pointer" asChild>
|
||||
<Link to="/setup">
|
||||
<div className="flex size-6 items-center justify-center rounded-md border bg-transparent">
|
||||
<PlusIcon className="size-4" />
|
||||
</div>
|
||||
<div className="text-muted-foreground font-medium">
|
||||
Adicionar empresa
|
||||
</div>
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
import type { Route } from './+types/route'
|
||||
|
||||
import { useForm } from 'react-hook-form'
|
||||
import { PatternFormat } from 'react-number-format'
|
||||
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage
|
||||
} from '@repo/ui/components/ui/form'
|
||||
import { Input } from '@repo/ui/components/ui/input'
|
||||
import { Button } from '@repo/ui/components/ui/button'
|
||||
|
||||
export default function Route({}: Route.ComponentProps) {
|
||||
const form = useForm()
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="text-center">
|
||||
<h1 className="text-2xl font-semibold font-display text-balance">
|
||||
Crie sua empresa
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<Form {...form}>
|
||||
<form className="space-y-6">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="cnpj"
|
||||
render={({ field: { onChange, ref, ...props } }) => (
|
||||
<FormItem className="grid gap-3">
|
||||
<FormLabel>CNPJ</FormLabel>
|
||||
<FormControl>
|
||||
<PatternFormat
|
||||
format="##.###.###/####-##"
|
||||
mask="_"
|
||||
placeholder="__.___.__/____-__"
|
||||
customInput={Input}
|
||||
getInputRef={ref}
|
||||
onValueChange={({ value }) => {
|
||||
onChange(value)
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
/>
|
||||
|
||||
<Button type="submit" className="w-full">
|
||||
Continuar
|
||||
</Button>
|
||||
</form>
|
||||
</Form>
|
||||
</>
|
||||
)
|
||||
}
|
||||
38
apps/admin.saladeaula.digital/app/routes/_.setup/route.tsx
Normal file
38
apps/admin.saladeaula.digital/app/routes/_.setup/route.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { Route } from './+types/route'
|
||||
|
||||
import { Link, Outlet } from 'react-router'
|
||||
import { ChevronLeftIcon } from 'lucide-react'
|
||||
|
||||
import logo from '@repo/ui/components/logo2.svg'
|
||||
import { authMiddleware } from '@repo/auth/middleware/auth'
|
||||
|
||||
export const middleware: Route.MiddlewareFunction[] = [authMiddleware]
|
||||
|
||||
export function meta({}: Route.MetaArgs) {
|
||||
return [{ title: 'Crie sua empresa' }]
|
||||
}
|
||||
|
||||
export default function Route({}: Route.ComponentProps) {
|
||||
return (
|
||||
<>
|
||||
<div className="flex min-h-svh w-full items-center justify-center p-6 md:p-10 relative">
|
||||
<Link
|
||||
to="/"
|
||||
className="flex items-center gap-0.5 absolute top-5 left-5 text-sm z-2"
|
||||
>
|
||||
<ChevronLeftIcon className="size-5" /> Voltar
|
||||
</Link>
|
||||
|
||||
<div className="w-full max-w-xs relative max-sm:mt-10 z-1 space-y-6">
|
||||
<div className="flex justify-center">
|
||||
<div className="border border-white/15 bg-white/5 px-2.5 py-3 rounded-xl">
|
||||
<img src={logo} alt="EDUSEG®" className="block size-12" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Outlet />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -264,7 +264,7 @@ function ActionMenu({
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon-sm"
|
||||
className="cursor-pointer"
|
||||
className="cursor-pointer data-[state=open]:bg-muted "
|
||||
disabled={disabled}
|
||||
>
|
||||
<EllipsisIcon />
|
||||
|
||||
Reference in New Issue
Block a user