Skip to content

Commit 8f82674

Browse files
committed
card registration
1 parent bf29d3b commit 8f82674

File tree

8 files changed

+49
-23
lines changed

8 files changed

+49
-23
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
REACT_APP_API_PATH=http://localhost:3000/
2-
# REACT_APP_API_PATH=https://br-ipti-beneficiarios.azurewebsites.net/
1+
# REACT_APP_API_PATH=http://localhost:3000/
2+
REACT_APP_API_PATH=https://br-ipti-beneficiarios.azurewebsites.net/

src/Components/Card/CardRegistration/index.tsx

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { ConfirmDialog } from "primereact/confirmdialog";
22
import { useContext, useState } from "react";
33
import { useNavigate, useParams } from "react-router-dom";
4-
import IconActive from "../../../Assets/images/activeRegistration.svg";
5-
import IconClasMedia from "../../../Assets/images/iconClasMedia.svg";
6-
import IconNotActive from "../../../Assets/images/notactiveRegistration.svg";
4+
import avatar from "../../../Assets/images/avatar.svg"
75
import { RegistrationClassroomContext } from "../../../Context/Classroom/RegistrationsList/context";
86
import { RegistrationClassroomTypes } from "../../../Context/Classroom/RegistrationsList/type";
97
import { ROLE, Status } from "../../../Controller/controllerGlobal";
@@ -12,17 +10,20 @@ import Icon from "../../Icon";
1210
import { Container } from "./style";
1311
import { AplicationContext } from "../../../Context/Aplication/context";
1412
import { PropsAplicationContext } from "../../../Types/types";
13+
import color from "../../../Styles/colors";
1514

1615
const CardRegistration = ({
1716
title,
1817
subtitle,
1918
idRegistration,
2019
status,
20+
avatar_url
2121
}: {
2222
title: string;
2323
subtitle: string;
2424
idRegistration: number;
2525
status: string;
26+
avatar_url: string
2627
}) => {
2728
const [visible, setVisible] = useState(false);
2829
const history = useNavigate();
@@ -42,7 +43,7 @@ const CardRegistration = ({
4243
return (
4344
<>
4445
<Container
45-
className="card cursor-pointer"
46+
className="card"
4647
onClick={(e) => {
4748
e.stopPropagation();
4849
if ((propsAplication.user?.role === ROLE.ADMIN ||
@@ -51,11 +52,11 @@ const CardRegistration = ({
5152
}
5253
}}
5354
>
54-
<Row id="space-between">
55-
<h3>{subtitle}</h3>
55+
<Row id="end" >
5656
{(propsAplication.user?.role === ROLE.ADMIN ||
5757
propsAplication.user?.role === ROLE.COORDINATORS) && <div
5858
className="cursor-pointer"
59+
style={{ marginBottom: "-32px" }}
5960
onClick={(e) => {
6061
e.stopPropagation();
6162
setVisible(true);
@@ -70,26 +71,24 @@ const CardRegistration = ({
7071
<Column id="center">
7172
<img
7273
src={
73-
status === statuGlobal.APPROVED
74-
? IconActive
75-
: status === statuGlobal.PENDING
76-
? IconClasMedia
77-
: status === statuGlobal.REPROVED
78-
? IconNotActive
79-
: ""
74+
avatar_url ?? avatar
8075
}
8176
alt=""
82-
style={{ height: 40 }}
77+
style={{ height: 72, width: 72, borderRadius: "50%" }}
8378
/>
8479
</Column>
8580
</div>
8681
<Padding />
8782
<Column>
88-
<div className={"boxDescriptionSchedule"}>
89-
{"Matricula - " + title}
90-
</div>
91-
<Padding />
92-
<div className={"boxDescriptionScheduleSubtitle"}>
83+
<div style={{fontWeight: "500",
84+
padding: 4, textAlign: "center", width: "96px", color: "white", borderRadius: "16px", backgroundColor: `${status === statuGlobal.APPROVED
85+
? color.green
86+
: status === statuGlobal.PENDING
87+
? color.colorCardOrange
88+
: status === statuGlobal.REPROVED
89+
? color.red
90+
: ""}`
91+
}}>
9392
{status === statuGlobal.APPROVED
9493
? "Aprovado"
9594
: status === statuGlobal.PENDING
@@ -98,6 +97,14 @@ const CardRegistration = ({
9897
? "Reprovado"
9998
: ""}
10099
</div>
100+
<Padding />
101+
<h4>{subtitle}</h4>
102+
<Padding />
103+
104+
105+
<div className={"boxDescriptionSchedule"}>
106+
{"Matricula - " + title}
107+
</div>
101108
</Column>
102109
</Row>
103110
</Container>

src/Components/Card/CardRegistration/style.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ import styled from "styled-components";
22
import styles from "../../../Styles";
33

44
export const Container = styled.div`
5-
color: ${styles.colors.grayClear};
65
font-size: ${styles.typography.font.extraSmall};
76
justify-content: space-between;
7+
cursor: pointer;
8+
9+
border: 1.22px solid rgba(219, 230, 255, 1);
10+
background: ${styles.colors.colorCard};
11+
12+
border-radius: 16px;
813
914
.boxQuantity {
1015
display: flex;

src/Context/Classroom/Registration/type.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export interface UpdateRegister
3232
kinship: string | undefined | null
3333
}
3434
export interface RegistrationType {
35+
avatar_url: string
3536
id: number
3637
registration_fk: number
3738
classroom_fk: number

src/Context/Classroom/RegistrationsList/type.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export interface Registration {
2424
id: number
2525
name: string
2626
birthday: string
27+
avatar_url: string
2728
cpf: string
2829
sex: number
2930
color_race: number

src/Pages/Beneficiaries/BeneficiariesEdit/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const BeneficiariesEdit = () => {
3333
);
3434
};
3535

36-
const Avatar = styled.div`
36+
export const Avatar = styled.div`
3737
border: 1px solid ${styles.colors.colorBorderCard};
3838
height: 128px;
3939
width: 128px;

src/Pages/Classroom/ClassroomOne/RegistrationList/Registration/index.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import {
1818
} from "../../../../../Controller/controllerGlobal";
1919
import { useFetchRequestClassroomOne } from "../../../../../Services/Classroom/query";
2020
import { Padding } from "../../../../../Styles/styles";
21+
import { Avatar } from "../../../../Beneficiaries/BeneficiariesEdit";
22+
import avatar from "../../../../../Assets/images/avatar.svg"
23+
2124

2225
const Registration = () => {
2326
return (
@@ -40,6 +43,8 @@ const RegistrationPage = () => {
4043
return (
4144
<ContentPage title={classroom?.name} description="Detalhes da matricula do beneficiário">
4245
<Padding padding="16px" />
46+
47+
4348
{props.registration ? (
4449
<Formik
4550
initialValues={props.initialValue}
@@ -74,6 +79,10 @@ const RegistrationPage = () => {
7479
</div>
7580
</div>{" "}
7681
<Padding padding="8px" />
82+
<Avatar>
83+
<img alt="" src={props.registration?.avatar_url ? props.registration?.avatar_url : avatar} />
84+
</Avatar>
85+
<Padding padding="16px" />
7786
<h3>Dados basicos</h3>
7887
<Padding />
7988
<div className="grid">

src/Pages/Classroom/ClassroomOne/RegistrationList/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const RegistrationListPage = () => {
3939
return props.registrations;
4040
};
4141

42+
43+
console.log(props.registrations)
4244
return (
4345
<ContentPage title={classroom?.name} description="Visualização das matriculas realizadas na turma.">
4446
<Row id="space-between">
@@ -64,6 +66,7 @@ const RegistrationListPage = () => {
6466
subtitle={item.registration.name}
6567
idRegistration={item.id}
6668
status={item.status}
69+
avatar_url={item.registration.avatar_url}
6770
/>
6871
</div>
6972
);

0 commit comments

Comments
 (0)