-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a85f289
commit 3498832
Showing
3 changed files
with
104 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,49 @@ | ||
import { Input } from "@/components/ui/input" | ||
import { Button } from "@/components/ui/button" | ||
"use client"; | ||
|
||
import { FormEvent } from "react"; | ||
import { Input } from "@/components/ui/input"; | ||
import { Button } from "@/components/ui/button"; | ||
import EventTable from "@/app/form-tutor/ui/table/table"; | ||
import { Header } from "@/components/header" | ||
import { Header } from "@/components/header"; | ||
|
||
const inputDivStyling = "w-96 my-3" | ||
const tableDivStyling = "my-10 w-full h-full" | ||
const inputDivStyling = "w-96 my-3"; | ||
const tableDivStyling = "my-10 w-full h-full"; | ||
|
||
export default function Page() { | ||
return ( | ||
<div className="w-full h-full"> | ||
<Header></Header> | ||
<div className="w-fit mx-auto p-10"> | ||
<h1 className="font-bold text-2xl">Anmeldung Vorkurstutor:in</h1> | ||
|
||
<div className={inputDivStyling}> | ||
<Input placeholder="Vorname"/> | ||
</div> | ||
|
||
<div className={inputDivStyling}> | ||
<Input placeholder="Nachname"/> | ||
</div> | ||
|
||
<div className={inputDivStyling}> | ||
<Input type="email" placeholder="E-Mail" /> | ||
</div> | ||
|
||
<div className={tableDivStyling}> | ||
<EventTable/> | ||
</div> | ||
|
||
<div className={inputDivStyling}> | ||
<Button>Submit</Button> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
async function onSubmit(event: FormEvent<HTMLFormElement>) { | ||
event.preventDefault() | ||
const formData = new FormData(event.currentTarget); | ||
alert(formData.get("fn")); | ||
} | ||
|
||
return ( | ||
<div className="w-full h-full"> | ||
<Header></Header> | ||
<div className="w-fit mx-auto p-10"> | ||
<form onSubmit={onSubmit}> | ||
<h1 className="font-bold text-2xl">Anmeldung Vorkurstutor:in</h1> | ||
|
||
<div className={inputDivStyling}> | ||
<Input type="text" name="fn" placeholder="Vorname" /> | ||
</div> | ||
|
||
<div className={inputDivStyling}> | ||
<Input type="text" name="sn" placeholder="Nachname" /> | ||
</div> | ||
|
||
<div className={inputDivStyling}> | ||
<Input type="email" name="email" placeholder="E-Mail" /> | ||
</div> | ||
|
||
<div className={tableDivStyling}> | ||
<EventTable /> | ||
</div> | ||
|
||
<div className={inputDivStyling}> | ||
<Button type="submit">Submit</Button> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,40 @@ | ||
"use client" | ||
|
||
import { ColumnDef } from "@tanstack/react-table" | ||
import { Checkbox } from "@/components/ui/checkbox" | ||
import { ColumnDef } from "@tanstack/react-table"; | ||
import { Checkbox } from "@/components/ui/checkbox"; | ||
|
||
// This type is used to define the shape of our data. | ||
// You can use a Zod schema here if you want. | ||
export type Vorlesung = { | ||
isSelected: boolean, | ||
name: string | ||
date: string | ||
} | ||
|
||
export const columns: ColumnDef<Vorlesung>[] = [ | ||
{ | ||
accessorKey: "isSelected", | ||
header: "", | ||
cell: ({ row }) => ( | ||
|
||
<div className="w-full flex flex-row justify-center"> | ||
<Checkbox | ||
className={"mx-auto"} | ||
checked={row.getIsSelected()} | ||
onCheckedChange={(value) => row.toggleSelected(!!value)} | ||
aria-label="Ich kann diese Vorlesung halten" | ||
/> | ||
</div> | ||
export type Event = { | ||
id: string; | ||
title: string; | ||
from: Date; | ||
to: Date; | ||
}; | ||
|
||
), | ||
}, | ||
{ | ||
accessorKey: "name", | ||
header: "Name der Veranstaltung", | ||
}, | ||
{ | ||
accessorKey: "date", | ||
header: "Datum", | ||
}, | ||
] | ||
export const columns: ColumnDef<Event>[] = [ | ||
{ | ||
accessorKey: "isSelected", | ||
header: "", | ||
cell: ({ row }) => ( | ||
<div className="w-full flex flex-row justify-center"> | ||
<Checkbox | ||
className={"mx-auto"} | ||
checked={row.getIsSelected()} | ||
onCheckedChange={(value) => row.toggleSelected(!!value)} | ||
aria-label="Ich kann diese Vorlesung halten" | ||
/> | ||
</div> | ||
), | ||
}, | ||
{ | ||
accessorKey: "name", | ||
header: "Veranstaltung", | ||
}, | ||
{ | ||
accessorKey: "from", | ||
header: "Von", | ||
}, | ||
{ | ||
accessorKey: "to", | ||
header: "Bis", | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters