mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 07:36:41 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
52c43fd510
commit
d629591030
3 changed files with 107 additions and 3 deletions
|
|
@ -9,8 +9,20 @@
|
||||||
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
||||||
|
|
||||||
import { Route as rootRouteImport } from './routes/__root'
|
import { Route as rootRouteImport } from './routes/__root'
|
||||||
|
import { Route as SignupRouteImport } from './routes/signup'
|
||||||
|
import { Route as LoginRouteImport } from './routes/login'
|
||||||
import { Route as IndexRouteImport } from './routes/index'
|
import { Route as IndexRouteImport } from './routes/index'
|
||||||
|
|
||||||
|
const SignupRoute = SignupRouteImport.update({
|
||||||
|
id: '/signup',
|
||||||
|
path: '/signup',
|
||||||
|
getParentRoute: () => rootRouteImport,
|
||||||
|
} as any)
|
||||||
|
const LoginRoute = LoginRouteImport.update({
|
||||||
|
id: '/login',
|
||||||
|
path: '/login',
|
||||||
|
getParentRoute: () => rootRouteImport,
|
||||||
|
} as any)
|
||||||
const IndexRoute = IndexRouteImport.update({
|
const IndexRoute = IndexRouteImport.update({
|
||||||
id: '/',
|
id: '/',
|
||||||
path: '/',
|
path: '/',
|
||||||
|
|
@ -19,28 +31,50 @@ const IndexRoute = IndexRouteImport.update({
|
||||||
|
|
||||||
export interface FileRoutesByFullPath {
|
export interface FileRoutesByFullPath {
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
|
'/login': typeof LoginRoute
|
||||||
|
'/signup': typeof SignupRoute
|
||||||
}
|
}
|
||||||
export interface FileRoutesByTo {
|
export interface FileRoutesByTo {
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
|
'/login': typeof LoginRoute
|
||||||
|
'/signup': typeof SignupRoute
|
||||||
}
|
}
|
||||||
export interface FileRoutesById {
|
export interface FileRoutesById {
|
||||||
__root__: typeof rootRouteImport
|
__root__: typeof rootRouteImport
|
||||||
'/': typeof IndexRoute
|
'/': typeof IndexRoute
|
||||||
|
'/login': typeof LoginRoute
|
||||||
|
'/signup': typeof SignupRoute
|
||||||
}
|
}
|
||||||
export interface FileRouteTypes {
|
export interface FileRouteTypes {
|
||||||
fileRoutesByFullPath: FileRoutesByFullPath
|
fileRoutesByFullPath: FileRoutesByFullPath
|
||||||
fullPaths: '/'
|
fullPaths: '/' | '/login' | '/signup'
|
||||||
fileRoutesByTo: FileRoutesByTo
|
fileRoutesByTo: FileRoutesByTo
|
||||||
to: '/'
|
to: '/' | '/login' | '/signup'
|
||||||
id: '__root__' | '/'
|
id: '__root__' | '/' | '/login' | '/signup'
|
||||||
fileRoutesById: FileRoutesById
|
fileRoutesById: FileRoutesById
|
||||||
}
|
}
|
||||||
export interface RootRouteChildren {
|
export interface RootRouteChildren {
|
||||||
IndexRoute: typeof IndexRoute
|
IndexRoute: typeof IndexRoute
|
||||||
|
LoginRoute: typeof LoginRoute
|
||||||
|
SignupRoute: typeof SignupRoute
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@tanstack/react-router' {
|
declare module '@tanstack/react-router' {
|
||||||
interface FileRoutesByPath {
|
interface FileRoutesByPath {
|
||||||
|
'/signup': {
|
||||||
|
id: '/signup'
|
||||||
|
path: '/signup'
|
||||||
|
fullPath: '/signup'
|
||||||
|
preLoaderRoute: typeof SignupRouteImport
|
||||||
|
parentRoute: typeof rootRouteImport
|
||||||
|
}
|
||||||
|
'/login': {
|
||||||
|
id: '/login'
|
||||||
|
path: '/login'
|
||||||
|
fullPath: '/login'
|
||||||
|
preLoaderRoute: typeof LoginRouteImport
|
||||||
|
parentRoute: typeof rootRouteImport
|
||||||
|
}
|
||||||
'/': {
|
'/': {
|
||||||
id: '/'
|
id: '/'
|
||||||
path: '/'
|
path: '/'
|
||||||
|
|
@ -53,7 +87,18 @@ declare module '@tanstack/react-router' {
|
||||||
|
|
||||||
const rootRouteChildren: RootRouteChildren = {
|
const rootRouteChildren: RootRouteChildren = {
|
||||||
IndexRoute: IndexRoute,
|
IndexRoute: IndexRoute,
|
||||||
|
LoginRoute: LoginRoute,
|
||||||
|
SignupRoute: SignupRoute,
|
||||||
}
|
}
|
||||||
export const routeTree = rootRouteImport
|
export const routeTree = rootRouteImport
|
||||||
._addFileChildren(rootRouteChildren)
|
._addFileChildren(rootRouteChildren)
|
||||||
._addFileTypes<FileRouteTypes>()
|
._addFileTypes<FileRouteTypes>()
|
||||||
|
|
||||||
|
import type { getRouter } from './router.tsx'
|
||||||
|
import type { createStart } from '@tanstack/react-start'
|
||||||
|
declare module '@tanstack/react-start' {
|
||||||
|
interface Register {
|
||||||
|
ssr: true
|
||||||
|
router: Awaited<ReturnType<typeof getRouter>>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
21
src/routes/login.tsx
Normal file
21
src/routes/login.tsx
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { createFileRoute, Link } from "@tanstack/react-router";
|
||||||
|
import { Logo } from "@/components/mika/Logo";
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/login")({
|
||||||
|
component: LoginPlaceholder,
|
||||||
|
});
|
||||||
|
|
||||||
|
function LoginPlaceholder() {
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen grid place-items-center bg-background px-4">
|
||||||
|
<div className="max-w-md text-center space-y-4">
|
||||||
|
<Logo size="lg" />
|
||||||
|
<h1 className="text-2xl font-bold">Login</h1>
|
||||||
|
<p className="text-muted-foreground">
|
||||||
|
A página de login completa será implementada na Etapa 2 (Auth + Supabase).
|
||||||
|
</p>
|
||||||
|
<Link to="/" className="inline-block text-primary hover:underline">← Voltar para o início</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
38
src/routes/signup.tsx
Normal file
38
src/routes/signup.tsx
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
import { createFileRoute, Link } from "@tanstack/react-router";
|
||||||
|
import { Logo } from "@/components/mika/Logo";
|
||||||
|
|
||||||
|
type SignupSearch = {
|
||||||
|
plan?: string;
|
||||||
|
cycle?: "monthly" | "yearly";
|
||||||
|
};
|
||||||
|
|
||||||
|
export const Route = createFileRoute("/signup")({
|
||||||
|
validateSearch: (search: Record<string, unknown>): SignupSearch => ({
|
||||||
|
plan: typeof search.plan === "string" ? search.plan : undefined,
|
||||||
|
cycle: search.cycle === "yearly" || search.cycle === "monthly" ? search.cycle : undefined,
|
||||||
|
}),
|
||||||
|
component: SignupPlaceholder,
|
||||||
|
});
|
||||||
|
|
||||||
|
function SignupPlaceholder() {
|
||||||
|
const { plan, cycle } = Route.useSearch();
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen grid place-items-center bg-background px-4">
|
||||||
|
<div className="max-w-md text-center space-y-4">
|
||||||
|
<Logo size="lg" />
|
||||||
|
<h1 className="text-2xl font-bold">Criar conta</h1>
|
||||||
|
<p className="text-muted-foreground">
|
||||||
|
Cadastro completo será implementado na Etapa 2.
|
||||||
|
</p>
|
||||||
|
{plan && (
|
||||||
|
<p className="text-sm bg-primary/10 text-primary rounded-lg px-3 py-2 inline-block">
|
||||||
|
Plano selecionado: <strong>{plan}</strong> · {cycle === "yearly" ? "anual" : "mensal"}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
<div>
|
||||||
|
<Link to="/" className="inline-block text-primary hover:underline">← Voltar para o início</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue