feat: make the web app installable and rework the app shell
Add a Vite PWA (`vite-plugin-pwa`): manifest, icons and an `autoUpdate` service worker, plus an install prompt so the app can be added to the home screen. Rework the shell for mobile: mount the bottom navigation bar and the install prompt in the authenticated layout, hide the sidebar trigger below `md`, and add a sign-out card to Settings. Drop the placeholder Tasks page together with its unused shadcn table and the `@tanstack/react-table` dependency, and remove the in-app router/query dev tools.
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
import { zodResolver } from '@hookform/resolvers/zod'
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
import { createFileRoute, useNavigate } from '@tanstack/react-router'
|
||||
import { useState } from 'react'
|
||||
import { useForm } from 'react-hook-form'
|
||||
import { z } from 'zod'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
import { Field, FieldDescription, FieldError, FieldGroup, FieldLabel } from '@/components/ui/field'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Switch } from '@/components/ui/switch'
|
||||
import { useSession } from '@/lib/auth-client'
|
||||
import { signOut, useSession } from '@/lib/auth-client'
|
||||
|
||||
export const Route = createFileRoute('/_authenticated/settings')({
|
||||
component: SettingsPage,
|
||||
@@ -24,6 +23,7 @@ type ProfileValues = z.infer<typeof profileSchema>
|
||||
|
||||
function SettingsPage() {
|
||||
const { data: session } = useSession()
|
||||
const navigate = useNavigate()
|
||||
const [saved, setSaved] = useState(false)
|
||||
|
||||
const form = useForm<ProfileValues>({
|
||||
@@ -108,6 +108,24 @@ function SettingsPage() {
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Sesión</CardTitle>
|
||||
<CardDescription>Cierra sesión en este dispositivo.</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={async () => {
|
||||
await signOut()
|
||||
await navigate({ to: '/sign-in' })
|
||||
}}
|
||||
>
|
||||
Cerrar sesión
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user