Skip to content

Commit

Permalink
Merge pull request #292 from MeeTeamIdle/release-1.0
Browse files Browse the repository at this point in the history
Release 1.0.3
  • Loading branch information
prgmr99 authored Nov 13, 2024
2 parents c90c6d2 + b9dd82f commit b7cc135
Show file tree
Hide file tree
Showing 32 changed files with 304 additions and 115 deletions.
30 changes: 30 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@
href="/meeteam_banner_icon_large.webp"
type="image/webp"
/>
<link rel="stylesheet" href="/src/globalStyle.css" />
<link
rel="preload"
href="src/styles/fonts/NotoSansKR-Light.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="src/styles/fonts/NotoSansKR-Regular.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="src/styles/fonts/NotoSansKR-Medium.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="src/styles/fonts/NotoSansKR-Bold.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="page-enter" content="blendTrans(duration=1)" />
<meta http-equiv="page-exit" content="blendTrans(duration=1)" />
Expand Down
6 changes: 3 additions & 3 deletions src/components/comment/commentInput/CommentInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ const CommentInput = () => {
<textarea
value={contents}
onChange={onChangeHandler}
maxLength={1000}
placeholder='댓글을 입력해주세요. 댓글의 글자 수는 1000자로 제한합니다.'
maxLength={100}
placeholder='댓글을 입력해주세요. 댓글의 글자 수는 100자로 제한합니다.'
/>
</section>
<section className='container-length_counter'>
<span className='body2-medium'>
{contents.length > 1000 ? 1000 : contents.length}/1000
{contents.length > 100 ? 100 : contents.length}/100
</span>
</section>
<section className='container-btn'>
Expand Down
63 changes: 4 additions & 59 deletions src/components/header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,25 @@
import React, { useEffect, useState, useRef } from 'react';
import React, { useState, useRef } from 'react';
import S from './Header.styled';
import { useLocation, useNavigate, useParams } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
import { DropdownArrow } from '../../assets';
import { ProfileImage } from '..';
import { useRecoilState, useSetRecoilState } from 'recoil';
import { recruitFilterState, userState, loginState } from '../../atom';
import { userState, loginState } from '../../atom';
import { useSignOut, useLogin, useReadProfileImage, useOutsideClick } from '../../hooks';

const Header = () => {
const { id } = useParams();
const { isLogin } = useLogin();
const location = useLocation();
const dropdownRef = useRef<HTMLDivElement | null>(null);
const navigate = useNavigate();

const [openDrop, setOpenDrop] = useState<boolean>(false);
const [isHere, setIsHere] = useState({
recruit: false,
mySchool: false,
inform: false,
});
const [userInfo, setUserState] = useRecoilState(userState);

const setFilterState = useSetRecoilState(recruitFilterState);
const setLoginState = useSetRecoilState(loginState);

const { mutate: signOut } = useSignOut({ setUserState, setLoginState });
const { data: profileImage } = useReadProfileImage(isLogin);

const handleRecruitBoardButtonClick = () => {
navigate('/');
setFilterState({
scope: 1,
category: null,
field: null,
skill: [],
role: [],
tag: [],
keyword: '',
course: null,
professor: null,
});
};

const onClickMy = () => {
if (!isLogin) {
navigate('/signin');
Expand All @@ -58,35 +35,11 @@ const Header = () => {
};

const handleLogoClick = () => {
if (!isLogin) {
navigate('/');
return;
}

navigate('/campus');
setFilterState({
scope: 2,
category: null,
field: null,
skill: [],
role: [],
tag: [],
keyword: '',
course: null,
professor: null,
});
navigate('/');
};

useOutsideClick(dropdownRef, openDrop, setOpenDrop);

useEffect(() => {
if (location.pathname === '/') {
setIsHere({ recruit: true, mySchool: false, inform: false });
} else {
setIsHere({ recruit: false, mySchool: false, inform: false });
}
}, [location.pathname, id]);

return (
<S.Header $isLogin={isLogin}>
<div className='header'>
Expand All @@ -102,14 +55,6 @@ const Header = () => {
/>
{isLogin && <span className='university'>{userInfo?.university}</span>}
</div>
<div className='header__navigation'>
<div
className={`header__navigation--navi-text ${isHere.recruit ? 'here' : ''}`}
onClick={handleRecruitBoardButtonClick}
>
구인게시판
</div>
</div>
</section>
<section>
<div className='header__menu'>
Expand Down
2 changes: 2 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ import SearchBar from './recruit/recruitBoard/searchBar/SearchBar';
import FieldPopup from './recruit/recruitBoard/fieldPopup/FieldPopup';
import LoadingBackground from './loading/LoadingBackground';
import TextBox from './dropdown/textBox/TextBox';
import CampusToggle from './recruit/recruitBoard/toggle/CampusToggle';

export {
Header,
Expand Down Expand Up @@ -192,4 +193,5 @@ export {
FieldPopup,
LoadingBackground,
TextBox,
CampusToggle,
};
78 changes: 78 additions & 0 deletions src/components/recruit/recruitBoard/toggle/CampusToggle.styled.ts
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 src/components/recruit/recruitBoard/toggle/CampusToggle.tsx
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;
46 changes: 46 additions & 0 deletions src/globalStyle.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import url('/src/styles/fonts/font.css');

html {
font-size: 62.5%;
font-family: Pretendard;
Expand Down Expand Up @@ -194,3 +196,47 @@ button {
line-height: 2.4rem;
letter-spacing: 0.004rem;
}

@font-face {
font-family: 'Noto Sans CJK KR';
font-style: normal;
font-weight: 100;
font-display: swap;
src:
url('styles/fonts/NotoSansKR-Light.woff2') format('woff2'),
url('styles/fonts/NotoSansKR-Light.woff') format('woff'),
url('styles/fonts/NotoSansKR-Light.otf') format('truetype');
}

@font-face {
font-family: 'Noto Sans CJK KR';
font-style: normal;
font-weight: normal;
font-display: swap;
src:
url('styles/fonts/NotoSansKR-Regular.woff2') format('woff2'),
url('styles/fonts/NotoSansKR-Regular.woff') format('woff'),
url('styles/fonts/NotoSansKR-Regular.otf') format('truetype');
}

@font-face {
font-family: 'Noto Sans CJK KR';
font-style: normal;
font-weight: 500;
font-display: swap;
src:
url('styles/fonts/NotoSansKR-Medium.woff2') format('woff2'),
url('styles/fonts/NotoSansKR-Medium.woff') format('woff'),
url('styles/fonts/NotoSansKR-Medium.otf') format('truetype');
}

@font-face {
font-family: 'Noto Sans CJK KR';
font-style: normal;
font-weight: bold;
font-display: swap;
src:
url('styles/fonts/NotoSansKR-Bold.woff2') format('woff2'),
url('styles/fonts/NotoSansKR-Bold.woff') format('woff'),
url('styles/fonts/NotoSansKR-Bold.otf') format('truetype');
}
Loading

0 comments on commit b7cc135

Please sign in to comment.