Refactor authentication components and enhance user session handling

- Updated AccountPopover to utilize session data for user information display.
- Modified ApplicationLayout to fetch user details from the database using Prisma.
- Replaced Checkbox components with native input elements in SignUpForm for better accessibility.
- Enhanced seed script to include default islands and create related data in the database.
This commit is contained in:
2024-12-01 07:40:21 +05:00
parent b91f34b6b1
commit 3f8bb4e70a
4 changed files with 45 additions and 12 deletions

View File

@ -20,7 +20,6 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Checkbox } from "../ui/checkbox";
type AtollWithIslands = Prisma.AtollGetPayload<{
include: {
@ -241,7 +240,8 @@ export default function SignUpForm({ atolls }: { atolls: AtollWithIslands[] }) {
)}
<div className="flex flex-col gap-2 items-start justify-start py-2">
<div className="flex gap-2 items-center">
<Checkbox
<input
type="checkbox"
defaultChecked={(actionState.payload?.get("terms") || "") as string === 'on'}
name="terms" id="terms" />
<label
@ -263,7 +263,9 @@ export default function SignUpForm({ atolls }: { atolls: AtollWithIslands[] }) {
)}
<div className="flex gap-2 items-center">
<Checkbox
<input
type="checkbox"
defaultChecked={(actionState.payload?.get("policy") || "") as string === 'on'}
name="policy" id="terms" />
<label
htmlFor="terms"