Skip to content

Commit

Permalink
Merge pull request #6 from fga-eps-mds/US3-Validar-status-do-sindical…
Browse files Browse the repository at this point in the history
…izado-por-QR-Code

US3 validar status do sindicalizado por qr code
  • Loading branch information
daniso0412 authored Dec 9, 2024
2 parents 06ceb94 + 8379b24 commit 34efafe
Show file tree
Hide file tree
Showing 10 changed files with 489 additions and 25 deletions.
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"react-icons": "^5.2.1",
"react-input-mask": "^2.0.4",
"react-number-format": "^5.4.0",
"react-qr-code": "^2.0.15",
"react-router-dom": "^6.23.1",
"vitest-sonar-reporter": "^2.0.0"
},
Expand Down
20 changes: 19 additions & 1 deletion src/Components/SideBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,25 @@ export default function SideBar({ fullHeight = true }) {
navigate("/carteirinha");
setIsSideBarOpen(false);
}}
/>
/>,
<SideButton
hidden={user ? "none" : "flex"}
key="Verificarsindicalizado"
text="VERIFICAR SINDICALIZADO"
onClick={() => {
navigate("/verificar-membro");
setIsSideBarOpen(false);
}}
/>,
<SideButton
hidden={checkModule(permissions, "users") ? "flex" : "none"}
key="Verificarsindicalizado"
text="VERIFICAR SINDICALIZADO"
onClick={() => {
navigate("/verificar-membro");
setIsSideBarOpen(false);
}}
/>
];

return (
Expand Down
22 changes: 13 additions & 9 deletions src/Pages/Protected/Carteirinha/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
}

.info-block span {
font-size: 13px;
font-size: 16px;
color: #333;
}

Expand All @@ -108,32 +108,35 @@
}

.qr-section {
margin: 20px 0;
margin-top: 20px;
text-align: center;
}

.qr-code {
align-content: center;
width: 200px;
margin-bottom: 10px;
border: 7px solid #d49a3c;
border-radius: 5px;
padding: 5px;
height: auto;
margin: auto;
border: 5px solid #d49a3c;
border-radius: 5px;
padding: 5px;
background-color: #fff;
}
.qr-code-numero{
font-weight: 900;
line-height: 123.5%;
font-size: 25px;
color: #341F14 !important;
margin: -12px;
margin-top: 13px;
margin-bottom: 8px;
text-shadow: 0px 4px 4px rgba(226, 183, 61, 0.25);

}

.carteirinha-footer {
color: #341F14;
font-size: 12px;
margin-top: 10px;
margin-top: 0px;
font-weight:900;
text-align: center;
}
Expand All @@ -144,11 +147,12 @@
align-items: center;
justify-content: center;
gap: 10px;
margin-top: 10px;
margin-top: -120px;
}

.social-icon {
font-size: 20px;
margin-top: 130px;
color: #333;
cursor: pointer;
transition: color 0.3s ease;
Expand Down
54 changes: 39 additions & 15 deletions src/Pages/Protected/Carteirinha/index.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useRef, useState, useEffect } from "react";

Check failure on line 1 in src/Pages/Protected/Carteirinha/index.jsx

View workflow job for this annotation

GitHub Actions / lint

'React' is defined but never used

Check failure on line 1 in src/Pages/Protected/Carteirinha/index.jsx

View workflow job for this annotation

GitHub Actions / lint

'useEffect' is defined but never used
import QRCode from "react-qr-code";
import "./index.css";

import { jsPDF } from "jspdf";
Expand All @@ -7,14 +8,16 @@ import html2canvas from "html2canvas";
import badgeLogo from "../../../assets/sindpol-logo.png";
import penalLogo from "../../../assets/penal_df-min.png.png";
import qrCode from "../../../assets/qr-code.png";

Check failure on line 10 in src/Pages/Protected/Carteirinha/index.jsx

View workflow job for this annotation

GitHub Actions / lint

'qrCode' is defined but never used
import { FaFacebook, FaInstagram, FaTwitter, FaYoutube } from "react-icons/fa";
import { FaFacebook, FaInstagram, FaYoutube } from "react-icons/fa";
import { FaXTwitter } from "react-icons/fa6";


const Carteirinha = () => {
const cardRef = useRef(null);
const [membershipData, setMembershipData] = useState(null);

Check failure on line 17 in src/Pages/Protected/Carteirinha/index.jsx

View workflow job for this annotation

GitHub Actions / lint

'membershipData' is assigned a value but never used

Check failure on line 17 in src/Pages/Protected/Carteirinha/index.jsx

View workflow job for this annotation

GitHub Actions / lint

'setMembershipData' is assigned a value but never used

// Fetch Membership data
useEffect(() => {
/* useEffect(() => {
const fetchMembership = async () => {
try {
const response = await fetch("http://localhost:3001/membership");
Expand All @@ -28,6 +31,7 @@ const Carteirinha = () => {
fetchMembership();
}, []);
*/

const downloadPDF = async () => {
const element = cardRef.current;
Expand Down Expand Up @@ -64,6 +68,8 @@ const Carteirinha = () => {
button.style.display = ""; // Mostra o botão novamente
};

/*
// Render loading state
if (!membershipData) {
return <div>Carregando dados...</div>;
Expand All @@ -77,6 +83,17 @@ const Carteirinha = () => {
hiringDate
} = membershipData;
*/


const list = {
titular: "Dannyeclisson",
dataDeNascimento: "24/11/2001",
dataExpedicao: "21/06/2019",
CPF: "074.885.581-54",
validade: "30/11/2024",
};

return (
<div className="carteirinha-container" ref={cardRef}>
<div className="carteirinha">
Expand All @@ -90,28 +107,33 @@ const Carteirinha = () => {
<div className="carteirinha-info">
<div className="info-line">
<div className="info-block">
<strong>TITULAR:</strong><br />
<p className="info-color-titular"><span>{name}</span></p>
<strong>TITULAR:</strong><br/>
<p className="info-color-titular"><span>{list.titular}</span></p>
{/*<p className="info-color-titular"><span>{name}</span></p>*/}
</div>
</div>
<div className="info-line">
<div className="info-block">
<strong>DATA DE NASCIMENTO:</strong><br />
<p className="info-color"><span>{new Date(birthDate).toLocaleDateString()}</span></p>
<strong>DATA DE NASCIMENTO:</strong><br/>
<p className="info-color"><span>{list.dataDeNascimento}</span></p>
{/*<p className="info-color"><span>{new Date(birthDate).toLocaleDateString()}</span></p>*/}
</div>
<div className="info-block">
<strong>DATA DE EXPEDIÇÃO:</strong><br />
<p className="info-color"><span>{new Date(expeditionDate).toLocaleDateString()}</span></p>
<strong>DATA DE EXPEDIÇÃO:</strong><br/>
<p className="info-color"><span>{list.dataExpedicao}</span></p>
{/*<p className="info-color"><span>{new Date(expeditionDate).toLocaleDateString()}</span></p>*/}
</div>
</div>
<div className="info-line">
<div className="info-block">
<strong>CPF:</strong><br />
<p className="info-color"><span>{cpf}</span></p>
<strong>CPF:</strong><br/>
<p className="info-color"><span>{list.CPF}</span></p>
{/*<p className="info-color"><span>{cpf}</span></p>*/}
</div>
<div className="info-block">
<strong>CONTRATAÇÃO:</strong><br />
<p className="info-color"><span>{new Date(hiringDate).toLocaleDateString()}</span></p>
<strong>CONTRATAÇÃO:</strong><br/>
<p className="info-color"><span>{list.validade}</span></p>
{/*<p className="info-color"><span>{new Date(hiringDate).toLocaleDateString()}</span></p>*/}
</div>
</div>
</div>
Expand All @@ -133,17 +155,19 @@ const Carteirinha = () => {
</p>
</footer>
<div className="qr-section">
<img src={qrCode} alt="QR Code" className="qr-code" />
<div className="qr-code">
<QRCode value="http://localhost:5173/verificar-membro" size={170} /> {/* endereço que será passado no qrCode */}
</div>
<p className="qr-code-numero">(61) 3321-1949</p>
</div>

<footer className="carteirinha-footer">
<p>sindpol.org.br / [email protected]</p>
<div className="social-media">
<FaInstagram className="social-icon" />
<FaInstagram className="social-icon" />
<FaYoutube className="social-icon" />
<FaFacebook className="social-icon" />
<FaTwitter className="social-icon" />
<FaXTwitter className="social-icon" />
</div>
<span>@sindpoldf</span>
<div className="footer-logos">
Expand Down
121 changes: 121 additions & 0 deletions src/Pages/Public/VerifyMember/VerifyMemberActiveStatus/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
.block-container {
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
background-color: #fff;
min-height: 100vh;
gap: 15px;
}

.block {
background: #eae3d7;
height: 420px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
width: 650px;
padding: 20px 30px;
text-align: center;
font-family: Arial, sans-serif, 'Noto Sans';
margin-top: 200px;

}

.block-header {
color: #341F14;
font-size: 15px;
margin-top: 3px;
margin-bottom: 20px;
margin-left: -10px;
font-weight: bold !important;
font-weight: 500;
}

.block h1 {
font-family: 'Noto Sans';
font-weight: 900;
letter-spacing: -2.5px;
line-height: 123.5%;
font-size: 70px;
color: #AE883C !important;
margin: -12px;
margin-top: 10px;
text-shadow: 0px 100px 80px rgba(226, 183, 61, 0.25);
}

.block-header p {
color: #341F14;
font-size: 15px;
margin-top: 3px;
margin-left: -10px;
font-weight: 800 !important;
margin-bottom: 5px;
}

.inf-line {
display: flex;
gap: 25px;
margin-bottom: 10px;
margin-top: 5px;
margin-left: 20px;
}

.inf-block {
margin-left: 5px;
font-size: 13px;
margin-top: 20px;
text-align: left;
}

.inf-block strong {
font-weight: 900;
color: #341F14;
margin-left: -5px;
font-weight: 900 !important;
}

.inf-block span{
font-size: 20px;
margin: 2px;
}

.inf-color{
background-color: white;
border-radius: 6px;
padding: 5px 28px;
padding-left: 5px;
padding-top: 10px;
width: 185px;
height: 40px;
margin-top: 5px;
margin-left: -5px;
}

.inf-color-titular{
background-color: white;
border-radius: 6px;
padding: 5px 28px;
padding-left: 5px;
padding-top: 10px;
width: 550px;
height: 40px;
margin-top: 5px;
margin-left: -5px;

}

.foot-logo {
width: 130px;
height: auto;
margin-top: -3px;
margin-left: -10px;
}

.Sindicalizado{
font-family: 'Noto Sans' !important;
color: #AE883C !important;
font-size: 20px !important;
font-weight: 900 !important;
text-shadow: 0px 4px 4px rgba(226, 183, 61, 0.25);
margin-top: -5px;
}
Loading

0 comments on commit 34efafe

Please sign in to comment.