refactor: streamline imports in AsignaturaPreviewCard and $planId components; update animation duration in styles
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { createFileRoute, Link, useRouter } from "@tanstack/react-router"
|
||||
import { createFileRoute, Link } from "@tanstack/react-router"
|
||||
import { useEffect, useMemo, useRef, useState } from "react"
|
||||
import * as Icons from "lucide-react"
|
||||
import { useMutation, useQueryClient, useSuspenseQuery } from "@tanstack/react-query"
|
||||
@@ -9,15 +9,15 @@ import { AcademicSections, planKeys } from "@/components/planes/academic-section
|
||||
import { GradientMesh } from "../../../components/planes/GradientMesh"
|
||||
import { asignaturaExtraOptions, asignaturaKeys, asignaturasCountOptions, asignaturasPreviewOptions, planByIdOptions, type AsignaturaLite, type PlanFull } from "@/components/planes/planQueries"
|
||||
import { softAccentStyle } from "@/components/planes/planHelpers"
|
||||
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "@radix-ui/react-dialog"
|
||||
import { Dialog, DialogContent, DialogDescription, DialogTitle } from "@/components/ui/dialog"
|
||||
import { DialogFooter, DialogHeader } from "@/components/ui/dialog"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Label } from "@radix-ui/react-label"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import confetti from "canvas-confetti"
|
||||
import { Textarea } from "@/components/ui/textarea"
|
||||
import { AuroraButton } from "@/components/effect/aurora-button"
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@radix-ui/react-tabs"
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
|
||||
|
||||
type LoaderData = { planId: string }
|
||||
|
||||
@@ -37,7 +37,6 @@ export const Route = createFileRoute("/_authenticated/plan/$planId")({
|
||||
|
||||
// ...existing code...
|
||||
function RouteComponent() {
|
||||
const router = useRouter()
|
||||
const qc = useQueryClient()
|
||||
const { planId } = Route.useLoaderData() as LoaderData
|
||||
const auth = useSupabaseAuth()
|
||||
|
||||
@@ -1,22 +1,34 @@
|
||||
import { createFileRoute, Link } from '@tanstack/react-router'
|
||||
import { Button } from "@/components/ui/button"
|
||||
import '../App.css'
|
||||
import { useSupabaseAuth } from "@/auth/supabase"
|
||||
|
||||
export const Route = createFileRoute('/')({
|
||||
component: App
|
||||
})
|
||||
|
||||
function App() {
|
||||
|
||||
const auth = useSupabaseAuth()
|
||||
const isAuth = !!auth.user
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col bg-gradient-to-br from-white via-slate-200 to-primary">
|
||||
{/* Navbar */}
|
||||
<header className="flex items-center justify-between px-10 py-6 border-b border-slate-700/50">
|
||||
<h1 className="text-2xl font-mono tracking-tight">Acad-IA</h1>
|
||||
<Link to="/login" search={{ redirect: '/planes' }}>
|
||||
<Button variant="outline" className="border-slate-500 hover:bg-slate-700/50">
|
||||
Iniciar sesión
|
||||
</Button>
|
||||
</Link>
|
||||
{isAuth ? (
|
||||
<Link to="/planes">
|
||||
<Button className="border-slate-500 hover:bg-slate-700/50 relative overflow-hidden">
|
||||
<span className="absolute inset-0 animate-aurora" />
|
||||
|
||||
Comenzar
|
||||
</Button>
|
||||
</Link>
|
||||
) : (
|
||||
<Link to="/login" search={{ redirect: '/planes' }}>
|
||||
<Button variant="outline" className="border-slate-500 hover:bg-slate-700/50">
|
||||
Iniciar sesión
|
||||
</Button>
|
||||
</Link>
|
||||
)}
|
||||
</header>
|
||||
|
||||
{/* Hero */}
|
||||
|
||||
Reference in New Issue
Block a user