-
Notifications
You must be signed in to change notification settings - Fork 1
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 #292 from MeeTeamIdle/release-1.0
Release 1.0.3
- Loading branch information
Showing
32 changed files
with
304 additions
and
115 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
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
78 changes: 78 additions & 0 deletions
78
src/components/recruit/recruitBoard/toggle/CampusToggle.styled.ts
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,78 @@ | ||
import styled from 'styled-components'; | ||
|
||
const CampusToggle = styled.section` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 21.8rem; | ||
height: 6rem; | ||
border-radius: 99.9rem; | ||
border: 0.075rem solid #f6f6f6; | ||
background: #f8fafb; | ||
margin-top: 2rem; | ||
gap: 1rem; | ||
.wrapper { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 8.8rem; | ||
height: 4rem; | ||
border-radius: 9999.9rem; | ||
} | ||
.selected { | ||
background-color: #e0e6ff; | ||
color: #2f4fd9; | ||
&:hover { | ||
background-color: #e0e6ff; | ||
cursor: pointer; | ||
} | ||
} | ||
.notSelected { | ||
background-color: #f8fafb; | ||
color: #747b7f; | ||
&:hover { | ||
background-color: #ededed; | ||
cursor: pointer; | ||
} | ||
} | ||
@media (max-width: 900px) { | ||
width: 18rem; | ||
height: 5rem; | ||
.wrapper { | ||
width: 7rem; | ||
height: 3.2rem; | ||
border-radius: 9999.9rem; | ||
} | ||
.option { | ||
font-size: 1.8rem; | ||
} | ||
} | ||
@media (max-width: 600px) { | ||
margin: 2rem auto 0rem; | ||
width: 16rem; | ||
height: 4.4rem; | ||
.wrapper { | ||
width: 6rem; | ||
height: 3rem; | ||
border-radius: 9999.9rem; | ||
} | ||
.option { | ||
font-size: 1.6rem; | ||
} | ||
} | ||
`; | ||
|
||
const S = { CampusToggle }; | ||
|
||
export default S; |
91 changes: 91 additions & 0 deletions
91
src/components/recruit/recruitBoard/toggle/CampusToggle.tsx
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,91 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import S from './CampusToggle.styled'; | ||
import { useLocation, useNavigate } from 'react-router-dom'; | ||
import { useRecoilState, useSetRecoilState } from 'recoil'; | ||
import { needLoginModalState, recruitFilterState, recruitFilterStateAuth } from '../../../../atom'; | ||
import { useLogin } from '../../../../hooks'; | ||
import ModalBackground from '../../../modalBackground/ModalBackground'; | ||
import NeedLogin from '../../recruitDetail/modal/needLogin/NeedLogin'; | ||
|
||
const CampusToggle = () => { | ||
const location = useLocation(); | ||
const navigate = useNavigate(); | ||
const { isLogin } = useLogin(); | ||
|
||
const [isCampus, setIsCampus] = useState<boolean>(false); | ||
const [needLoginModal, setNeedLoginModal] = useRecoilState(needLoginModalState); | ||
|
||
const setFilterState = useSetRecoilState(recruitFilterState); | ||
const setFilterStateAuth = useSetRecoilState(recruitFilterStateAuth); | ||
|
||
const handleCampusOutClick = () => { | ||
navigate('/'); | ||
setFilterStateAuth({ | ||
scope: 1, | ||
category: null, | ||
field: null, | ||
skill: [], | ||
role: [], | ||
tag: [], | ||
keyword: '', | ||
course: null, | ||
professor: null, | ||
}); | ||
setIsCampus(false); | ||
}; | ||
|
||
const handleCampusInClick = () => { | ||
if (!isLogin) { | ||
setNeedLoginModal({ isOpen: true, type: 'SCHOOL_RECRUIT' }); | ||
return; | ||
} | ||
|
||
navigate('/campus'); | ||
setFilterState({ | ||
scope: 2, | ||
category: null, | ||
field: null, | ||
skill: [], | ||
role: [], | ||
tag: [], | ||
keyword: '', | ||
course: null, | ||
professor: null, | ||
}); | ||
setIsCampus(true); | ||
}; | ||
|
||
useEffect(() => { | ||
if (location.pathname === '/campus') { | ||
setIsCampus(true); | ||
} else { | ||
setIsCampus(false); | ||
} | ||
}, [location.pathname]); | ||
|
||
return ( | ||
<> | ||
<S.CampusToggle> | ||
<article | ||
className={`wrapper ${isCampus ? 'notSelected' : 'selected'}`} | ||
onClick={handleCampusOutClick} | ||
> | ||
<span className='h3 option'>교외</span> | ||
</article> | ||
<article | ||
className={`wrapper ${isCampus ? 'selected' : 'notSelected'}`} | ||
onClick={handleCampusInClick} | ||
> | ||
<span className='h3 option'>교내</span> | ||
</article> | ||
</S.CampusToggle> | ||
{needLoginModal.isOpen && ( | ||
<ModalBackground> | ||
<NeedLogin type={needLoginModal.type} /> | ||
</ModalBackground> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default CampusToggle; |
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
Oops, something went wrong.