Skip to content

Commit

Permalink
[월간조회] 데스크탑뷰 QA이슈 해결 (#20)
Browse files Browse the repository at this point in the history
* fix: 월간조회 데스크탑뷰 QA 이슈 해결

* feat: 날짜 이동 버튼 추가

* feat: 엑셀 다운로드 버튼에 툴팁 추가

* fix: lint 에러 수정

* fix: lint 에러 수정

* fix: 모바일 드롭다운 컴포넌트 이름 변경

* refactor: QA 반영

* refactor: 엑셀 다운로드 기능 부분 수정

* fix: lint 에러 수정

* refactor: Setting1 네이밍 변경 및 위치 이동

* fix: 스타일 수정

* fix: 코드 중복 제거

* fix: z-index 값 수정 및 css 주석 제거

* fix: 커스텀 훅 사용

* refactor: 조건부 렌더링을 props 전달 방식으로 변경

* fix: lint 에러 수정

---------

Co-authored-by: d0dam <[email protected]>
  • Loading branch information
JeongWon-CHO and D0Dam authored Oct 15, 2024
1 parent 925342e commit 2b15f7a
Show file tree
Hide file tree
Showing 34 changed files with 908 additions and 163 deletions.
69 changes: 69 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/fsevents-patch-21ad2b1333-8.zip
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"react-router-dom": "^6.9.0",
"react-scripts": "5.0.1",
"react-toastify": "^10.0.4",
"react-tooltip": "^5.28.0",
"sass": "^1.60.0",
"typescript": "^4.4.2",
"vite": "^5.2.12",
Expand Down
8 changes: 8 additions & 0 deletions src/assets/svg/auth/menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/svg/auth/search-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/svg/common/arrow-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/svg/common/arrow-right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/assets/svg/common/info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/assets/svg/common/loading.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ button {
ul {
list-style: none;
}

input::-webkit-inner-spin-button {
appearance: none;
}
50 changes: 50 additions & 0 deletions src/layout/Header/Dropdown.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.container {
position: absolute;
display: flex;
top: 80px;
right: 0;
width: 100%;
background-color: #f5f5f5;
box-shadow: 0 5px 7px rgb(0 0 0 / 10%);
z-index: 10;
flex-direction: column;
}

.setting-item__link {
text-decoration: none;
color: #333;
padding: 10px;
text-align: left;
width: calc(100% - 20px);

&:hover {
background-color: #f0f0f0;
}
}

.setting-item__button {
padding: 10px;
text-align: left;
width: 100%;
background: none;
border: none;
cursor: pointer;

&:hover {
background-color: #f0f0f0;
}
}

.setting-item__word {
font-size: 16px;
height: 30px;
color: #1f1f1f;
padding-left: 20px;
}

.setting-item__warning {
font-size: 16px;
height: 30px;
color: #ec2d30;
padding-left: 20px;
}
19 changes: 19 additions & 0 deletions src/layout/Header/Header.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,27 @@
}
}

.logo__icon {
margin-left: 24px;
}

.header__content {
display: flex;
gap: 8px;
align-items: center;
}

.menu-container {
display: flex;
gap: 8px;
margin-right: 24px;
}

.menu-icon {
background: none;
}

.search,
.menu {
cursor: pointer;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
align-items: center;
gap: 40px;
padding-right: 24px;
margin-right: 24px;
}

.setting-item__link,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Link } from 'react-router-dom';

import { useLogout } from 'query/auth';

import styles from './Setting.module.scss';
import styles from './HeaderNavigation.module.scss';

function Setting1() {
function HeaderNavigation() {
const { logout } = useLogout();

const handleLogout = () => {
Expand All @@ -23,4 +23,4 @@ function Setting1() {
);
}

export default Setting1;
export default HeaderNavigation;
34 changes: 34 additions & 0 deletions src/layout/Header/MobileDropdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { Link } from 'react-router-dom';

import { useLogout } from 'query/auth';

import styles from './Dropdown.module.scss';

interface MobileDropdownProps {
view: boolean;
}

function MobileDropdown({ view }: MobileDropdownProps) {
const { logout } = useLogout();

const handleLogout = () => {
logout();
};

return (
<div>
{view && (
<div className={styles.container}>
<Link className={styles['setting-item__link']} to="https://forms.gle/wqD6PkjZoaaHJ1bo8" target="_blank" rel="noopener noreferrer">
<div className={styles['setting-item__word']}>BCSD Lab에 문의하기</div>
</Link>
<button type="button" className={styles['setting-item__button']} onClick={handleLogout}>
<div className={styles['setting-item__warning']}>로그아웃</div>
</button>
</div>
)}
</div>
);
}

export default MobileDropdown;
41 changes: 35 additions & 6 deletions src/layout/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,45 @@
import { Link } from 'react-router-dom';

import Menu from 'assets/svg/auth/menu.svg?react';
import Logo from 'assets/svg/common/koin-logo.svg?react';
import Setting1 from 'pages/Coop/components/Setting';
import useBooleanState from 'hooks/useBooleanState';
import useMediaQuery from 'hooks/useMediaQuery';

import styles from './Header.module.scss';
import HeaderNavigation from './HeaderNavigation';
import MobileDropdown from './MobileDropdown';

function Header() {
const { isMobile } = useMediaQuery();
const [isOpen,,,, toggleIsOpen] = useBooleanState(false);

return (
<header
className={styles.header}
>
<Logo />
<header className={styles.header}>
<Logo className={styles.logo__icon} />
<nav className={styles.header__content}>
<Setting1 />
{isMobile ? (
<div>
<ul>
<div className={styles['menu-container']}>
{/* 월간조회 기능 추가 시 활성화 */}
{/* <SearchIcon className={styles.search} /> */}
<button
type="button"
onClick={toggleIsOpen}
className={styles['menu-icon']}
style={{ position: 'relative' }}
aria-label="메뉴 버튼"
>
<Menu className={styles.menu} />
</button>
<MobileDropdown view={isOpen} />
</div>
</ul>
<Link to="/setting" />
</div>
) : (
<HeaderNavigation />
)}
</nav>
</header>
);
Expand Down
Loading

0 comments on commit 2b15f7a

Please sign in to comment.