refactor: streamline imports in AsignaturaPreviewCard and $planId components; update animation duration in styles
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { Link } from "@tanstack/react-router"
|
import { Link } from "@tanstack/react-router"
|
||||||
import * as Icons from "lucide-react"
|
import * as Icons from "lucide-react"
|
||||||
import { useSuspenseQuery } from "@tanstack/react-query"
|
import { useSuspenseQuery } from "@tanstack/react-query"
|
||||||
import React, { useMemo } from "react"
|
import { useMemo } from "react"
|
||||||
import { asignaturaExtraOptions } from "./planQueries"
|
import { asignaturaExtraOptions } from "./planQueries"
|
||||||
import { SmallStat } from "./SmallStat"
|
import { SmallStat } from "./SmallStat"
|
||||||
|
|
||||||
|
|||||||
@@ -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 { useEffect, useMemo, useRef, useState } from "react"
|
||||||
import * as Icons from "lucide-react"
|
import * as Icons from "lucide-react"
|
||||||
import { useMutation, useQueryClient, useSuspenseQuery } from "@tanstack/react-query"
|
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 { GradientMesh } from "../../../components/planes/GradientMesh"
|
||||||
import { asignaturaExtraOptions, asignaturaKeys, asignaturasCountOptions, asignaturasPreviewOptions, planByIdOptions, type AsignaturaLite, type PlanFull } from "@/components/planes/planQueries"
|
import { asignaturaExtraOptions, asignaturaKeys, asignaturasCountOptions, asignaturasPreviewOptions, planByIdOptions, type AsignaturaLite, type PlanFull } from "@/components/planes/planQueries"
|
||||||
import { softAccentStyle } from "@/components/planes/planHelpers"
|
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 { DialogFooter, DialogHeader } from "@/components/ui/dialog"
|
||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
import { Input } from "@/components/ui/input"
|
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 confetti from "canvas-confetti"
|
||||||
import { Textarea } from "@/components/ui/textarea"
|
import { Textarea } from "@/components/ui/textarea"
|
||||||
import { AuroraButton } from "@/components/effect/aurora-button"
|
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 }
|
type LoaderData = { planId: string }
|
||||||
|
|
||||||
@@ -37,7 +37,6 @@ export const Route = createFileRoute("/_authenticated/plan/$planId")({
|
|||||||
|
|
||||||
// ...existing code...
|
// ...existing code...
|
||||||
function RouteComponent() {
|
function RouteComponent() {
|
||||||
const router = useRouter()
|
|
||||||
const qc = useQueryClient()
|
const qc = useQueryClient()
|
||||||
const { planId } = Route.useLoaderData() as LoaderData
|
const { planId } = Route.useLoaderData() as LoaderData
|
||||||
const auth = useSupabaseAuth()
|
const auth = useSupabaseAuth()
|
||||||
|
|||||||
@@ -1,22 +1,34 @@
|
|||||||
import { createFileRoute, Link } from '@tanstack/react-router'
|
import { createFileRoute, Link } from '@tanstack/react-router'
|
||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
import '../App.css'
|
import { useSupabaseAuth } from "@/auth/supabase"
|
||||||
|
|
||||||
export const Route = createFileRoute('/')({
|
export const Route = createFileRoute('/')({
|
||||||
component: App
|
component: App
|
||||||
})
|
})
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
|
|
||||||
|
const auth = useSupabaseAuth()
|
||||||
|
const isAuth = !!auth.user
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen flex flex-col bg-gradient-to-br from-white via-slate-200 to-primary">
|
<div className="min-h-screen flex flex-col bg-gradient-to-br from-white via-slate-200 to-primary">
|
||||||
{/* Navbar */}
|
{/* Navbar */}
|
||||||
<header className="flex items-center justify-between px-10 py-6 border-b border-slate-700/50">
|
<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>
|
<h1 className="text-2xl font-mono tracking-tight">Acad-IA</h1>
|
||||||
<Link to="/login" search={{ redirect: '/planes' }}>
|
{isAuth ? (
|
||||||
<Button variant="outline" className="border-slate-500 hover:bg-slate-700/50">
|
<Link to="/planes">
|
||||||
Iniciar sesión
|
<Button className="border-slate-500 hover:bg-slate-700/50 relative overflow-hidden">
|
||||||
</Button>
|
<span className="absolute inset-0 animate-aurora" />
|
||||||
</Link>
|
|
||||||
|
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>
|
</header>
|
||||||
|
|
||||||
{/* Hero */}
|
{/* Hero */}
|
||||||
|
|||||||
@@ -140,9 +140,9 @@
|
|||||||
|
|
||||||
.animate-aurora {
|
.animate-aurora {
|
||||||
background: radial-gradient(at 20% 30%, rgba(59, 130, 246, .5), transparent 50%),
|
background: radial-gradient(at 20% 30%, rgba(59, 130, 246, .5), transparent 50%),
|
||||||
radial-gradient(at 80% 70%, rgba(236, 72, 153, .5), transparent 50%),
|
radial-gradient(at 80% 70%, rgba(228, 3, 190, 0.671), transparent 50%),
|
||||||
radial-gradient(at 50% 100%, rgba(34, 197, 94, .5), transparent 50%);
|
radial-gradient(at 50% 100%, rgba(34, 197, 94, .5), transparent 50%);
|
||||||
background-size: 200% 200%;
|
background-size: 200% 200%;
|
||||||
animation: aurora 6s ease infinite;
|
animation: aurora 3s ease infinite;
|
||||||
filter: blur(12px) opacity(0.8);
|
filter: blur(12px) opacity(0.8);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user