Skip to content

Commit

Permalink
Merge pull request #173 from MeeTeamNumdle/release-1.0
Browse files Browse the repository at this point in the history
chore: 헤더, 필터 드랍다운 버그 수정
  • Loading branch information
prgmr99 authored May 7, 2024
2 parents ff38761 + b9f3007 commit 50d5de8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
23 changes: 15 additions & 8 deletions src/components/dropdown/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ const Dropdown = ({ data, initialData, scope, category, applicant, roleObj }: Dr
return Object.keys(obj).find(key => obj[key] === value);
};

const onClickDropdown = () => {
if (scope) {
setShowDropdown(true);
} else {
setShowDropdown(prev => !prev);
}
const onClickDropdown = (event: React.MouseEvent<HTMLDivElement>) => {
event.stopPropagation();
setShowDropdown(prev => !prev);
};

const handleRadio = (event: React.MouseEvent<HTMLDivElement>) => {
event.stopPropagation();
};

const onClickList = (event: React.MouseEvent<HTMLElement>, id?: number) => {
Expand Down Expand Up @@ -186,6 +187,9 @@ const Dropdown = ({ data, initialData, scope, category, applicant, roleObj }: Dr
setSearchParams(searchParams);
setShowDropdown(false);
};
const onClickInside = (event: React.MouseEvent<HTMLDivElement>) => {
event.stopPropagation();
};

useEffect(() => {
const outsideClick = (event: MouseEvent) => {
Expand Down Expand Up @@ -261,7 +265,10 @@ const Dropdown = ({ data, initialData, scope, category, applicant, roleObj }: Dr
<ul className='menu-container'>
{data?.map((e: string, index: number) => (
<React.Fragment key={index}>
<section className={`menu-scope ${e === '교내' && 'in'}`}>
<section
className={`menu-scope ${e === '교내' && 'in'}`}
onClick={handleRadio}
>
<input
type='radio'
id={`${index}`}
Expand All @@ -273,7 +280,7 @@ const Dropdown = ({ data, initialData, scope, category, applicant, roleObj }: Dr
<label htmlFor={`${index}`}>{e}</label>
</section>
{currentValue === '교내' && (
<section className='inside'>
<section className='inside' onClick={onClickInside}>
<section className='container-inside'>
<section className='intro'>
<span className='description'>
Expand Down
5 changes: 1 addition & 4 deletions src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,10 @@ const Header = () => {
useEffect(() => {
if (location.pathname === `/recruitment/postings/${id}` || location.pathname === '/') {
setIsHere({ recruit: true, galary: false, inform: false });
}
if (location.pathname === '/galary') {
setIsHere({ recruit: false, galary: true, inform: false });
} else {
setIsHere({ recruit: false, galary: false, inform: false });
}
}, [location]);
}, [location.pathname]);

useEffect(() => {
const outsideClick = (event: MouseEvent) => {
Expand Down

0 comments on commit 50d5de8

Please sign in to comment.