Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adicionar google tag manager #356

Merged
merged 18 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ REACT_APP_GOOGLE_ANALYTICS_KEY= # GA do SouJunior
REACT_APP_URL= # link do backend
REACT_APP_URL_JOBS= # link da api de jobs



## Rodando localmente ▶

Inicie o servidor
Expand Down Expand Up @@ -87,12 +85,12 @@ Esse projeto é usado pela [SouJunior](https://github.com/SouJunior).

## Feedback 💬

Se você tiver algum feedback, por favor nos deixe saber por meio do nosso [site](https://soujunior.tech). Ou fazendo uma [contribuição](#contribuição).
Se você tiver algum feedback, por favor nos deixe saber por meio do nosso [site](https://soujunior.tech). Ou fazendo uma [contribuição](#contribuição-).

## Contribuição 💙

Contribuições são sempre bem-vindas!

Veja `contribuindo.md` para saber como começar.
Veja [`contribuindo.md`](contribuindo.md) para saber como começar.

[Voltar ao 🔝](#vagas-frontend)
17 changes: 16 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Radio+Canada:wght@600&display=swap" rel="stylesheet">

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-5XLZKKV9');</script>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1TSQDBDCNZ"></script>
<script>
Expand All @@ -53,6 +58,16 @@
</head>

<body>
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-5XLZKKV9"
height="0"
width="0"
style="display:none;visibility:hidden">
</iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion src/components/CancelModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interface CancelModalProps {
handleConfirmCancel: () => void;
setCancelModal: (value: boolean) => void;
}
};

function CancelModal({
handleConfirmCancel,
Expand Down
11 changes: 1 addition & 10 deletions src/components/FooterDefault/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const FooterDefault = () => {
rel="noreferrer"
target="_blank"
>
Site Sou Junior
Site SouJunior
</a>
<li>
<a
Expand All @@ -67,15 +67,6 @@ const FooterDefault = () => {
SouJunior Labs
</a>
</li>
<li>
<a
href="https://discord.com/invite/564CDre9F3"
rel="noreferrer"
target="_blank"
>
SouJunior Talk
</a>
</li>
</ul>
</div>
<div>
Expand Down
6 changes: 0 additions & 6 deletions src/components/FooterDefault/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,31 +138,25 @@ export const Grid = styled.ul`
export const FacebookIcon = styled(TiSocialFacebook)`
width: 20px;
height: 20px;
color: #212121;
`;

export const YouTubeIcon = styled(BsYoutube)`
width: 20px;
height: 20px;
color: #212121;
`;
export const GitHubIcon = styled(BsGithub)`
width: 20px;
height: 20px;
color: #212121;
`;
export const LinkedInIcon = styled(AiFillLinkedin)`
width: 20px;
height: 20px;
color: #212121;
`;
export const InstagramIcon = styled(RiInstagramFill)`
width: 20px;
height: 20px;
color: #212121;
`;
export const TelegramIcon = styled(BsTelegram)`
width: 20px;
height: 20px;
color: #212121;
`;
18 changes: 16 additions & 2 deletions src/components/LoginCard/UserForms/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import {
MessageChecklist,
} from '../styles';
import { Popup } from '../PopUpRegisterSuccess/styles';
import TermsModal from '../../Portal/ProfileModal/TermsModal';
import PolicyModal from '../../Portal/ProfileModal/PolicyModal';

export const UserForms = (props: any): JSX.Element => {
const [hasError, setHasError] = useState(false);
Expand All @@ -44,8 +46,18 @@ export const UserForms = (props: any): JSX.Element => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [isFormSubmitted, setIsFormSubmitted] = useState(false);
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
const [policyModal, setPolicyModal] = useState<boolean>(false);
const [termsModal, setTermsModal] = useState<boolean>(false);


const handlePolicyModal = () => {
setPolicyModal(true);
};

const handleTermsModal = () => {
setTermsModal(true);
};

const characters = /^(?=.{8,20}$).*$/;
const letters = /^(?=.*[a-z])(?=.*[A-Z]).*$/;
const number = /^(?=.*\d).*$/;
Expand Down Expand Up @@ -362,8 +374,8 @@ export const UserForms = (props: any): JSX.Element => {
<CheckboxInput {...register('privacyTerms')} />
<TermsLink>
{/* TODO: Direcionar para as páginas correspondentes após criadas */}
Li e aceito os <a href="/">Termos de Uso</a> e{' '}
<br /> <a href="/">Política de Privacidade</a>
Li e aceito os <a onClick={handleTermsModal}>Termos de Uso</a> e{' '}
<br /> <a onClick={handlePolicyModal}>Política de Privacidade</a>
</TermsLink>
</Label>
{hasError && (
Expand Down Expand Up @@ -405,6 +417,8 @@ export const UserForms = (props: any): JSX.Element => {
/>
) : null}
<PopupHandler setPopup={setPopup} Popup={Popup} />
{termsModal && <TermsModal setTermsModal={setTermsModal} />}
{policyModal && <PolicyModal setPolicyModal={setPolicyModal} />}
</>
);
};
11 changes: 6 additions & 5 deletions src/components/Portal/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Menu = () => {
<Container>
<PopUp>
<MenuItems>
<li onClick={handleNavigation}
{/* <li onClick={handleNavigation}
onKeyDown={handleKeyDown}
tabIndex={0}
>
Expand All @@ -53,7 +53,7 @@ const Menu = () => {
Meu perfil
</li>

<Border />
<Border /> */}

{auth.user.type !== 'USER' && (
<li
Expand All @@ -66,7 +66,7 @@ const Menu = () => {
Anunciar vagas
</li>
)}
<Border />
{/* <Border /> */}
<li
onClick={() => {
setVisible(!visible);
Expand All @@ -89,6 +89,7 @@ const Menu = () => {
<li
tabIndex={0}
onKeyDown={handleKeyDown}
onClick={() => navigate('/change-password')}
>
<img
src={PasswordIcon}
Expand All @@ -99,14 +100,14 @@ const Menu = () => {
</div>
</>
)}
<Border />
{/* <Border />
<li
tabIndex={0}
onKeyDown={handleKeyDown}
>
<img src={TermsIcon} alt="termos" />
Termo de uso e Privacidade
</li>
</li> */}
<Border />
<li onClick={logout}
onKeyDown={handleKeyDown}
Expand Down
1 change: 1 addition & 0 deletions src/components/Portal/ProfileModal/CancelModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useContext } from 'react';

interface CancelModalProps {
setCancelModal: (value: boolean) => void;
open: boolean;
}

function CancelModal({ setCancelModal }: CancelModalProps) {
Expand Down
43 changes: 29 additions & 14 deletions src/components/Portal/ProfileModal/CancelModal/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ export const ModalContent = styled.div`
padding: 60px 30px;
gap: 20px;
position: fixed;

background: #FDFFFC;

border: 2px solid ${({ theme }) => theme.colors.primaryDark};
border-radius: 10px;
background: white;
border-radius: 8px;

@media (max-width: 280px) {
width: 100%;
Expand All @@ -25,6 +22,8 @@ export const ModalContent = styled.div`

export const ModalText = styled.p`
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
font-family: 'Radio Canada';
font-style: normal;
Expand All @@ -35,36 +34,52 @@ export const ModalText = styled.p`
color: ${({ theme }) => theme.colors.mutedDarker};

@media (max-width: 280px) {
width: 80%;
margin-top: 50px;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-size: 20px;
}

@media (max-width: 480px) {
width: 80%;
margin-top: 50px;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-size: 20px;
}
`;

export const ModalTitle = styled.h1`
display: flex;
justify-content: center;
align-items: center;
flex-wrap: wrap;
width: 370px;
height: 48px;
font-family: 'Radio Canada';
font-style: normal;
font-weight: 700;
font-size: 40px;
font-size: 30px;
line-height: 48px;
color: ${({ theme }) => theme.colors.primaryDark};

@media (max-width: 280px) {
width: 80%;
margin-right: 40px;

width: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 25px;
}

@media (max-width: 480px) {
width: 80%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 25px;
}
`;

Expand Down
66 changes: 66 additions & 0 deletions src/components/Portal/ProfileModal/ChangePasswordModal/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import {
ModalContent,
ModalTitle,
CloseModal,
ModalCloseButton,
} from './styles';
import ModalIcon from '../../../../assets/imgs/mask-group.svg';
import { useNavigate } from 'react-router';
import { MaskBackground } from '../../../LoginCard/PopUpRegisterSuccess/styles';
import { AuthContext } from '../../../../contexts/Auth/AuthContext';
import { useContext, useEffect, useRef } from 'react';

interface ChangePasswordModalProps {
setChangePasswordModal: (value: boolean) => void;
}

const ChangePasswordModal = ({ setChangePasswordModal }: ChangePasswordModalProps ) => {
const navigate = useNavigate();
const auth = useContext(AuthContext);
const modalRef = useRef<HTMLDivElement | null>(null);

const handleClick = () => {
setChangePasswordModal (false);
auth.user.type === 'USER' ?
(navigate('/candidate-portal'))
:
(navigate('/company-portal'))
setTimeout(() => window.location.reload(), 0)
document.body.style.overflow = 'auto';
}

useEffect(() => {
const handleOutsideClick = (e: MouseEvent) => {
if (modalRef.current && e.target instanceof Node && !modalRef.current.contains(e.target)) {
setChangePasswordModal (false);
handleClick();
}
};

document.addEventListener('click', handleOutsideClick);

return () => {
document.removeEventListener('click', handleOutsideClick);
};
}, []);

return (
<MaskBackground>
<ModalContent ref={modalRef}>
<CloseModal>
<ModalCloseButton
onClick={handleClick}
>
X
</ModalCloseButton>
</CloseModal>
<div className="modal--texts">
<ModalTitle>Senha atualizada com sucesso</ModalTitle>
<img src={ModalIcon} alt="Sucesso" />
</div>
</ModalContent>
</MaskBackground>
);
};

export default ChangePasswordModal;
Loading