Skip to content

Commit

Permalink
status registration, and status classroom fix: cards height
Browse files Browse the repository at this point in the history
  • Loading branch information
TI JONNY committed Dec 5, 2024
1 parent a03d535 commit d876887
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# REACT_APP_API_PATH=http://localhost:3000/
REACT_APP_API_PATH=https://br-ipti-beneficiarios.azurewebsites.net/
REACT_APP_API_PATH=http://localhost:3000/
# REACT_APP_API_PATH=https://br-ipti-beneficiarios.azurewebsites.net/
4 changes: 4 additions & 0 deletions src/Components/Card/CardClassroom/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export const Container = styled.div`
background: ${styles.colors.colorCard};
border-radius: 16px;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
.boxQuantity {
display: flex;
Expand Down
4 changes: 4 additions & 0 deletions src/Components/Card/CardMeeting/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export const Container = styled.div`
border: 1.22px solid rgba(219, 230, 255, 1);
background: ${styles.colors.colorCard};
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
border-radius: 16px;
Expand Down
4 changes: 4 additions & 0 deletions src/Components/Card/CardProject/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export const Container = styled.div`
border: 1.22px solid rgba(219, 230, 255, 1);
background: ${styles.colors.colorCard};
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
border-radius: 16px;
Expand Down
16 changes: 5 additions & 11 deletions src/Components/Card/CardRegistration/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useNavigate, useParams } from "react-router-dom";
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";
import { ROLE, Status, StatusEnum } from "../../../Controller/controllerGlobal";
import { Column, Padding, Row } from "../../../Styles/styles";
import Icon from "../../Icon";
import { Container } from "./style";
Expand Down Expand Up @@ -80,22 +80,16 @@ const CardRegistration = ({
</div>
<Padding />
<Column>
<div style={{fontWeight: "500",
padding: 4, textAlign: "center", width: "96px", color: "white", borderRadius: "16px", backgroundColor: `${status === statuGlobal.APPROVED
<div className="status" style={{fontWeight: "500",
padding: 4, textAlign: "center", minWidth: "96px", maxWidth: "128px", color: "white", borderRadius: "16px", backgroundColor: `${status === statuGlobal.APPROVED
? color.green
: status === statuGlobal.PENDING
? color.colorCardOrange
: status === statuGlobal.REPROVED
? color.red
: ""}`
: color.colorCardOrange}`
}}>
{status === statuGlobal.APPROVED
? "Aprovado"
: status === statuGlobal.PENDING
? "Pendente"
: status === statuGlobal.REPROVED
? "Reprovado"
: ""}
{StatusEnum[status]}
</div>
<Padding />
<h4>{subtitle}</h4>
Expand Down
14 changes: 14 additions & 0 deletions src/Components/Card/CardRegistration/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export const Container = styled.div`
border: 1.22px solid rgba(219, 230, 255, 1);
background: ${styles.colors.colorCard};
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
border-radius: 16px;
Expand All @@ -17,6 +21,16 @@ export const Container = styled.div`
font-size: ${styles.typography.font.extraSmall};
}
.status {
display: inline-block; /* Permite que a largura seja ajustada pelo conteúdo */
padding: 10px; /* Espaçamento interno */
border: 1px solid #ccc; /* Borda para destacar o div */
min-width: 150px; /* Largura mínima */
max-width: 300px; /* Largura máxima */
word-wrap: break-word; /* Quebra o texto se ele ultrapassar a largura máxima */
text-align: center;
}
`;

interface StatusProps {
Expand Down
4 changes: 4 additions & 0 deletions src/Components/Card/CardSchedule/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export const Container = styled.div`
color: ${styles.colors.grayClear};
font-size: ${styles.typography.font.extraSmall};
justify-content: space-between;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
.boxQuantity {
display: flex;
Expand Down
4 changes: 4 additions & 0 deletions src/Components/Card/CardTs/style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export const Container = styled.div`
border: 1.22px solid rgba(219, 230, 255, 1);
background: ${styles.colors.colorCard};
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
border-radius: 16px;
Expand Down
32 changes: 21 additions & 11 deletions src/Controller/controllerGlobal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from "axios";
import { Buffer } from 'buffer';
import { Buffer } from 'buffer';


export const gerarIdAleatorio = (tamanho: number) => {
Expand All @@ -24,15 +24,15 @@ export function formatarData(data: string): string {
export function converterData(data: string) {
// Divide a string pelo separador "/"
const partes = data.split('/');

// As partes serão: partes[0] = dia, partes[1] = mês, partes[2] = ano
const dia = partes[0];
const mes = partes[1];
const ano = partes[2];

// Reorganiza no formato YYYY-MM-DD
const dataFormatada = `${ano}-${mes}-${dia}`;

return dataFormatada;
}

Expand All @@ -51,19 +51,18 @@ export const VerifyColor = (color_race_number: number) => {
};

export const getStatus = (id: string) => {
const status = [
{ id: Status.APPROVED, name: "Aprovado" },
{ id: Status.REPROVED, name: "Reprovado" },
{ id: Status.PENDING, name: "Pedente" },
];
const status = getStatusList();
return status.find((props) => props.id === id);
};

export const getStatusList = () => {
const status = [
{ id: Status.APPROVED, name: "Aprovado" },
{ id: Status.REPROVED, name: "Reprovado" },
{ id: Status.PENDING, name: "Pedente" },
{ id: Status.PENDING, name: "Pendente" },
{ id: Status.PENDING_DOCUMENTATION, name: "Pendente de documentação" },
{ id: Status.PENDING_TERM, name: "Pendente de termo" },

];
return status;
};
Expand All @@ -72,7 +71,7 @@ export const getStatusList = () => {
export const getStatusClassroomList = () => {
const status = [
{ id: Status.APPROVED, name: "Aprovado" },
{ id: Status.PENDING, name: "Pedente" },
{ id: Status.PENDING, name: "Pendente" },
];
return status;
};
Expand All @@ -96,6 +95,17 @@ export const Status = {
APPROVED: "APPROVED",
PENDING: "PENDING",
REPROVED: "REPROVED",
PENDING_TERM: "PENDING_TERM",
PENDING_DOCUMENTATION: "PENDING_DOCUMENTATION"
};


export const StatusEnum: any = {
APPROVED: "Aprovado",
PENDING: "Pendente",
REPROVED: "Reprovado",
PENDING_TERM: "Pend. de termo",
PENDING_DOCUMENTATION: "Pend. de documentação"
};

export const ROLE = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Form, Formik } from "formik";
import { Button } from "primereact/button";
import { useContext } from "react";
import { useParams } from "react-router-dom";
import avatar from "../../../../../Assets/images/avatar.svg";
import ContentPage from "../../../../../Components/ContentPage";
import DropdownComponent from "../../../../../Components/Dropdown";
import MaskInput from "../../../../../Components/InputMask";
Expand All @@ -12,14 +13,13 @@ import RegistartionDetailsProvider, {
} from "../../../../../Context/Classroom/Registration/context";
import { RegistrationDetailsTypes } from "../../../../../Context/Classroom/Registration/type";
import {
Status,
color_race,
typesex,
getStatusList,
typesex
} 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 = () => {
Expand Down Expand Up @@ -70,11 +70,9 @@ const RegistrationPage = () => {
name="status"
placerholder="Status"
optionsLabel="name"
options={[
{ id: Status.APPROVED, name: "Aprovado" },
{ id: Status.REPROVED, name: "Reprovado" },
{ id: Status.PENDING, name: "Pedente" },
]}
options={
getStatusList()
}
/>
</div>
</div>{" "}
Expand Down

0 comments on commit d876887

Please sign in to comment.