From 8f826744d3414e84c991e8cbd2206398f58dccd8 Mon Sep 17 00:00:00 2001 From: jonnypaulino Date: Mon, 29 Jul 2024 18:47:37 -0300 Subject: [PATCH] card registration --- .env | 4 +- .../Card/CardRegistration/index.tsx | 45 +++++++++++-------- .../Card/CardRegistration/style.tsx | 7 ++- src/Context/Classroom/Registration/type.tsx | 1 + .../Classroom/RegistrationsList/type.tsx | 1 + .../Beneficiaries/BeneficiariesEdit/index.tsx | 2 +- .../RegistrationList/Registration/index.tsx | 9 ++++ .../ClassroomOne/RegistrationList/index.tsx | 3 ++ 8 files changed, 49 insertions(+), 23 deletions(-) diff --git a/.env b/.env index 77602a0..7c3a28b 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -REACT_APP_API_PATH=http://localhost:3000/ -# REACT_APP_API_PATH=https://br-ipti-beneficiarios.azurewebsites.net/ \ No newline at end of file +# REACT_APP_API_PATH=http://localhost:3000/ +REACT_APP_API_PATH=https://br-ipti-beneficiarios.azurewebsites.net/ \ No newline at end of file diff --git a/src/Components/Card/CardRegistration/index.tsx b/src/Components/Card/CardRegistration/index.tsx index e173f83..1b13e2a 100644 --- a/src/Components/Card/CardRegistration/index.tsx +++ b/src/Components/Card/CardRegistration/index.tsx @@ -1,9 +1,7 @@ import { ConfirmDialog } from "primereact/confirmdialog"; import { useContext, useState } from "react"; import { useNavigate, useParams } from "react-router-dom"; -import IconActive from "../../../Assets/images/activeRegistration.svg"; -import IconClasMedia from "../../../Assets/images/iconClasMedia.svg"; -import IconNotActive from "../../../Assets/images/notactiveRegistration.svg"; +import avatar from "../../../Assets/images/avatar.svg" import { RegistrationClassroomContext } from "../../../Context/Classroom/RegistrationsList/context"; import { RegistrationClassroomTypes } from "../../../Context/Classroom/RegistrationsList/type"; import { ROLE, Status } from "../../../Controller/controllerGlobal"; @@ -12,17 +10,20 @@ import Icon from "../../Icon"; import { Container } from "./style"; import { AplicationContext } from "../../../Context/Aplication/context"; import { PropsAplicationContext } from "../../../Types/types"; +import color from "../../../Styles/colors"; const CardRegistration = ({ title, subtitle, idRegistration, status, + avatar_url }: { title: string; subtitle: string; idRegistration: number; status: string; + avatar_url: string }) => { const [visible, setVisible] = useState(false); const history = useNavigate(); @@ -42,7 +43,7 @@ const CardRegistration = ({ return ( <> { e.stopPropagation(); if ((propsAplication.user?.role === ROLE.ADMIN || @@ -51,11 +52,11 @@ const CardRegistration = ({ } }} > - -

{subtitle}

+ {(propsAplication.user?.role === ROLE.ADMIN || propsAplication.user?.role === ROLE.COORDINATORS) &&
{ e.stopPropagation(); setVisible(true); @@ -70,26 +71,24 @@ const CardRegistration = ({
-
- {"Matricula - " + title} -
- -
+
{status === statuGlobal.APPROVED ? "Aprovado" : status === statuGlobal.PENDING @@ -98,6 +97,14 @@ const CardRegistration = ({ ? "Reprovado" : ""}
+ +

{subtitle}

+ + + +
+ {"Matricula - " + title} +
diff --git a/src/Components/Card/CardRegistration/style.tsx b/src/Components/Card/CardRegistration/style.tsx index e633fb4..139c7fe 100644 --- a/src/Components/Card/CardRegistration/style.tsx +++ b/src/Components/Card/CardRegistration/style.tsx @@ -2,9 +2,14 @@ import styled from "styled-components"; import styles from "../../../Styles"; export const Container = styled.div` - color: ${styles.colors.grayClear}; font-size: ${styles.typography.font.extraSmall}; justify-content: space-between; + cursor: pointer; + + border: 1.22px solid rgba(219, 230, 255, 1); + background: ${styles.colors.colorCard}; + + border-radius: 16px; .boxQuantity { display: flex; diff --git a/src/Context/Classroom/Registration/type.tsx b/src/Context/Classroom/Registration/type.tsx index b9cce83..e56d86e 100644 --- a/src/Context/Classroom/Registration/type.tsx +++ b/src/Context/Classroom/Registration/type.tsx @@ -32,6 +32,7 @@ export interface UpdateRegister kinship: string | undefined | null } export interface RegistrationType { + avatar_url: string id: number registration_fk: number classroom_fk: number diff --git a/src/Context/Classroom/RegistrationsList/type.tsx b/src/Context/Classroom/RegistrationsList/type.tsx index 4315e9d..1df6c8a 100644 --- a/src/Context/Classroom/RegistrationsList/type.tsx +++ b/src/Context/Classroom/RegistrationsList/type.tsx @@ -24,6 +24,7 @@ export interface Registration { id: number name: string birthday: string + avatar_url: string cpf: string sex: number color_race: number diff --git a/src/Pages/Beneficiaries/BeneficiariesEdit/index.tsx b/src/Pages/Beneficiaries/BeneficiariesEdit/index.tsx index cd6e1b9..a82a156 100644 --- a/src/Pages/Beneficiaries/BeneficiariesEdit/index.tsx +++ b/src/Pages/Beneficiaries/BeneficiariesEdit/index.tsx @@ -33,7 +33,7 @@ const BeneficiariesEdit = () => { ); }; -const Avatar = styled.div` +export const Avatar = styled.div` border: 1px solid ${styles.colors.colorBorderCard}; height: 128px; width: 128px; diff --git a/src/Pages/Classroom/ClassroomOne/RegistrationList/Registration/index.tsx b/src/Pages/Classroom/ClassroomOne/RegistrationList/Registration/index.tsx index 5a51018..e1a7204 100644 --- a/src/Pages/Classroom/ClassroomOne/RegistrationList/Registration/index.tsx +++ b/src/Pages/Classroom/ClassroomOne/RegistrationList/Registration/index.tsx @@ -18,6 +18,9 @@ import { } from "../../../../../Controller/controllerGlobal"; import { useFetchRequestClassroomOne } from "../../../../../Services/Classroom/query"; import { Padding } from "../../../../../Styles/styles"; +import { Avatar } from "../../../../Beneficiaries/BeneficiariesEdit"; +import avatar from "../../../../../Assets/images/avatar.svg" + const Registration = () => { return ( @@ -40,6 +43,8 @@ const RegistrationPage = () => { return ( + + {props.registration ? ( {
{" "} + + + +

Dados basicos

diff --git a/src/Pages/Classroom/ClassroomOne/RegistrationList/index.tsx b/src/Pages/Classroom/ClassroomOne/RegistrationList/index.tsx index 9511903..7ab21f8 100644 --- a/src/Pages/Classroom/ClassroomOne/RegistrationList/index.tsx +++ b/src/Pages/Classroom/ClassroomOne/RegistrationList/index.tsx @@ -39,6 +39,8 @@ const RegistrationListPage = () => { return props.registrations; }; + + console.log(props.registrations) return ( @@ -64,6 +66,7 @@ const RegistrationListPage = () => { subtitle={item.registration.name} idRegistration={item.id} status={item.status} + avatar_url={item.registration.avatar_url} />
);