-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #354 from biandradee/test
Fix: bugs
- Loading branch information
Showing
23 changed files
with
3,186 additions
and
3,109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { useState, useEffect } from 'react'; | ||
import { useNavigate, useLocation, useSearchParams } from 'react-router-dom'; | ||
|
||
import Search from '../../assets/imgs/search.svg'; | ||
import Location from '../../assets/imgs/location.svg'; | ||
|
||
import * as S from './styles'; | ||
import SwitchButton from '../SwitchButton'; | ||
|
||
|
||
const JobFilterPerfil = () => { | ||
const [searchParams, setSearchParams] = useSearchParams(); | ||
const [searchTerm, setSearchTerm] = useState(searchParams.get('search') || '',); | ||
const [location, setLocation] = useState(searchParams.get('location') || '',); | ||
const [isSwitchChecked, setIsSwitchChecked] = useState(false); | ||
const navigate = useNavigate(); | ||
const { pathname } = useLocation(); | ||
|
||
useEffect(() => { | ||
setIsSwitchChecked(false); | ||
}, [searchTerm, location]); | ||
|
||
const handleSubmit = (event: any) => { | ||
event.preventDefault(); | ||
|
||
if (pathname !== '/job') { | ||
setSearchParams({}); | ||
}; | ||
|
||
navigate(`/candidate-portal/job?search=${searchTerm}&location=${location}`); | ||
}; | ||
|
||
return ( | ||
<S.Container onSubmit={handleSubmit}> | ||
<S.BoxInput> | ||
<S.Input | ||
type="text" | ||
placeholder="Cargo, empresa, palavra-chave" | ||
maxLength={30} | ||
value={searchTerm} | ||
onChange={(event: any) => setSearchTerm(event.target.value)} | ||
/> | ||
|
||
<S.BtnIcon name="search btn" onClick={handleSubmit}> | ||
<img src={Search} alt="search btn" /> | ||
</S.BtnIcon> | ||
</S.BoxInput> | ||
|
||
<S.BoxInput className="location"> | ||
<S.Input | ||
type="text" | ||
placeholder="Local" | ||
maxLength={30} | ||
value={location} | ||
onChange={(event: any) => setLocation(event.target.value)} | ||
className="location" | ||
/> | ||
|
||
<S.BtnIcon className="location" name="location btn"> | ||
<img src={Location} alt="location btn" /> | ||
</S.BtnIcon> | ||
|
||
</S.BoxInput> | ||
|
||
<SwitchButton | ||
checked={isSwitchChecked} | ||
onChange={(event: any) => setIsSwitchChecked(event.target.checked)} | ||
/> | ||
|
||
{/* <S.Button type="submit">Pesquisar</S.Button> */} | ||
</S.Container> | ||
); | ||
}; | ||
|
||
export default JobFilterPerfil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Container = styled.form` | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 16px; | ||
height: 100%; | ||
@media (max-width: 1280px) { | ||
.location { | ||
display: none; | ||
} | ||
} | ||
@media (max-width: 1024px) { | ||
gap: 8px; | ||
} | ||
@media (max-width: 767px) { | ||
width: 100%; | ||
} | ||
`; | ||
|
||
export const BoxInput = styled.div` | ||
display: flex; | ||
align-items: center; | ||
position: relative; | ||
width: 256px; | ||
@media (max-width: 767px) { | ||
width: 100%; | ||
} | ||
`; | ||
|
||
export const Input = styled.input` | ||
position: relative; | ||
width: 100%; | ||
height: 45px; | ||
padding: 0 16px 0 40px; | ||
border: 1px solid #c1dfff; | ||
background: #eff3f9; | ||
border-radius: 42px; | ||
font-size: 14px; | ||
line-height: 120%; | ||
color: #666666; | ||
outline: none; | ||
:focus { | ||
outline-color: #1165ba; | ||
} | ||
@media (max-width: 767px) { | ||
height: 36px; | ||
} | ||
`; | ||
|
||
export const BtnIcon = styled.button` | ||
position: absolute; | ||
left: 14px; | ||
`; | ||
|
||
// export const Button = styled.button` | ||
// width: 116px; | ||
// height: 45px; | ||
// border: none; | ||
// border-radius: 24px; | ||
// background: #003986; | ||
// font-family: 'Radio Canada'; | ||
// font-size: 14px; | ||
// line-height: 140%; | ||
// color: #fff; | ||
// cursor: pointer; | ||
// transition: all 0.2s ease-in-out; | ||
|
||
// &:hover { | ||
// opacity: 0.8; | ||
// } | ||
|
||
// @media (max-width: 1024px) { | ||
// display: none; | ||
// } | ||
// `; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as React from 'react'; | ||
import Switch from '@mui/material/Switch'; | ||
import { Container } from './styles'; | ||
|
||
interface SwitchButtonProps { | ||
checked: boolean; | ||
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void; | ||
} | ||
|
||
export default function SwitchButton({ checked, onChange }: SwitchButtonProps) { | ||
const text = checked ? 'Alerta criado' : 'Alerta de vagas'; | ||
|
||
return ( | ||
<Container> | ||
<h2>{text}</h2> | ||
<Switch | ||
checked={checked} | ||
onChange={onChange} | ||
inputProps={{ 'aria-label': 'controlled' }} | ||
/> | ||
</Container> | ||
); | ||
} |
Oops, something went wrong.