diff --git a/backend/sql/schema.sql b/backend/sql/schema.sql index 85329c3..107fd6f 100644 --- a/backend/sql/schema.sql +++ b/backend/sql/schema.sql @@ -10,7 +10,8 @@ CREATE TABLE person ( person_dni VARCHAR(8) NOT NULL, person_names VARCHAR(50) NOT NULL, person_paternal_surname VARCHAR(30) NOT NULL, - person_maternal_surname VARCHAR(30) NOT NULL + person_maternal_surname VARCHAR(30) NOT NULL, + person_classroom_id INTEGER DEFAULT -1 ); CREATE TABLE course ( diff --git a/frontend/src/OnlineClassroom/ClassroomUserCreation.tsx b/frontend/src/OnlineClassroom/ClassroomUserCreation.tsx new file mode 100644 index 0000000..d36bcd7 --- /dev/null +++ b/frontend/src/OnlineClassroom/ClassroomUserCreation.tsx @@ -0,0 +1,31 @@ +import { createSignal } from "solid-js"; +import { FilledButton } from "../components/FilledButton"; +import { UserPlusIcon } from "../icons/UserPlusIcon"; +import { MaterialInput } from "../components/MaterialInput"; + +export function ClassroomUserCreation() { + const [email, setEmail] = createSignal("yuli.palo.apaza@gmail.com"); + const [loading, setLoading] = createSignal(false); + + return ( +
+

+ O cree un nuevo usuario: +

+ +
+ + + + + + Crear usuario + +
+ ); +} diff --git a/frontend/src/OnlineClassroom/ConnectionStatus.tsx b/frontend/src/OnlineClassroom/ConnectionStatus.tsx index bd7dffc..cee8d2c 100644 --- a/frontend/src/OnlineClassroom/ConnectionStatus.tsx +++ b/frontend/src/OnlineClassroom/ConnectionStatus.tsx @@ -34,7 +34,7 @@ export function ClassroomConection() { - Conectado + Ok diff --git a/frontend/src/OnlineClassroom/index.tsx b/frontend/src/OnlineClassroom/index.tsx index 442f3a1..f2685d6 100644 --- a/frontend/src/OnlineClassroom/index.tsx +++ b/frontend/src/OnlineClassroom/index.tsx @@ -1,7 +1,11 @@ import { Show, createSignal } from "solid-js"; import { Search } from "../certs/Search"; import { Person } from "../types/Person"; -import { ClassroomConection } from "./ConnectionStatus"; +import { FilledCard } from "../components/FilledCard"; +import { LinkIcon } from "../icons/LinkIcon"; +import { ClassroomUserCreation } from "./ClassroomUserCreation"; + +type TabType = "Vinculate" | "Create"; export function OnlineClassroom() { const [person, setPerson] = createSignal(null); @@ -10,10 +14,9 @@ export function OnlineClassroom() {
- - - - + + +
); @@ -21,12 +24,96 @@ export function OnlineClassroom() { -function ClassroomUsers(props: {person: Person}) { +function ClassroomUser(props: {person: Person}) { + const [active, setActive] = createSignal("Vinculate"); + return (
-

- Usuarios para {props.person.person_names}: -

+ +

+ Persona no vinculada: +

+ + +
+ + + + + + +
+ +
+
+ ); +} + +function ClassroomVinculation() { + return ( +
+

+ Vincule un usuario existente: +

+ + + +
+ ); +} + + + +function ClassroomSingleUser() { + return ( +
+
+ NOMBRE NOMBRE APELLIDO APELLIDO +
+
+ + NNAPELLA + +
+ registrado:  + + 26/05/2023 + +
+
+
+ +
+ ); +} + + +function ClassroomTabs(props: {active: TabType, setActive: (v: TabType) => void}) { + const presetsClasses = () => ((props.active === "Vinculate") ? "font-bold border-c-primary" : "border-c-transparent"); + const manualClasses = () => ((props.active === "Create") ? "font-bold border-c-primary" : "border-c-transparent"); + + return ( +
+ +
); } diff --git a/frontend/src/certs/Search/PersonRegister.tsx b/frontend/src/certs/Search/PersonRegister.tsx index 3ad0a42..37fa137 100644 --- a/frontend/src/certs/Search/PersonRegister.tsx +++ b/frontend/src/certs/Search/PersonRegister.tsx @@ -1,4 +1,5 @@ import { createSignal } from "solid-js"; +import { MaterialInput } from "../../components/MaterialInput"; export function PersonRegister(props: {dni: string, onRegister: () => void}) { const [paternalSurname, setPaternalSurname] = createSignal(""); @@ -48,22 +49,22 @@ export function PersonRegister(props: {dni: string, onRegister: () => void}) { }} > setPaternalSurname(v.toUpperCase())} - loading={loading()} + disabled={loading()} /> setMaternalSurname(v.toUpperCase())} - loading={loading()} + disabled={loading()} /> setNames(v.toUpperCase())} - loading={loading()} + disabled={loading()} /> + ); +} diff --git a/frontend/src/components/MaterialInput.tsx b/frontend/src/components/MaterialInput.tsx new file mode 100644 index 0000000..189da97 --- /dev/null +++ b/frontend/src/components/MaterialInput.tsx @@ -0,0 +1,32 @@ +export function MaterialInput(props: { + resourceName: string, + disabled: boolean, + value: string, + setValue: (v: string) => void, +}) { + let inputElement: HTMLInputElement | undefined; + + return ( +
+ props.setValue(e.target.value)} + disabled={props.disabled} + /> + + + +
+ ); +} diff --git a/frontend/src/components/TonalButton.tsx b/frontend/src/components/TonalButton.tsx new file mode 100644 index 0000000..56c9324 --- /dev/null +++ b/frontend/src/components/TonalButton.tsx @@ -0,0 +1,16 @@ +import { JSX } from "solid-js"; + +export function TonalButton(props: { + children?: Array | JSX.Element, + class?: string, + type?: "button" | "input", +}) { + return ( + + ); +} diff --git a/frontend/src/icons/LinkIcon.tsx b/frontend/src/icons/LinkIcon.tsx new file mode 100644 index 0000000..595d971 --- /dev/null +++ b/frontend/src/icons/LinkIcon.tsx @@ -0,0 +1,15 @@ + +export function LinkIcon(props: {fill: string, size?: number, class?: string}) { + return ( + + + + ); +} diff --git a/frontend/src/icons/UserPlusIcon.tsx b/frontend/src/icons/UserPlusIcon.tsx new file mode 100644 index 0000000..d9589ce --- /dev/null +++ b/frontend/src/icons/UserPlusIcon.tsx @@ -0,0 +1,15 @@ + +export function UserPlusIcon(props: {fill: string, size?: number, class?: string}) { + return ( + + + + ); +} diff --git a/frontend/src/types/Person.ts b/frontend/src/types/Person.ts index aed5c01..cf02532 100644 --- a/frontend/src/types/Person.ts +++ b/frontend/src/types/Person.ts @@ -5,5 +5,6 @@ export type Person = { person_names: string person_paternal_surname: string person_maternal_surname: string + person_classroom_id: string | undefined }