Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[월간조회] 데스크탑뷰 QA이슈 해결 #20

Merged
merged 17 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
43 changes: 37 additions & 6 deletions src/layout/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,47 @@
import { useState } from 'react';

Check failure on line 1 in src/layout/Header/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint

'useState' is declared but its value is never read.

Check warning on line 1 in src/layout/Header/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint

'useState' is defined but never used

Check warning on line 1 in src/layout/Header/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint

'useState' is defined but never used

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 [view,,,, setView] = useBooleanState(false);

return (
<header
className={styles.header}
>
<Logo />
<header className={styles.header}>
<Logo className={styles.logo__icon} />
<nav className={styles.header__content}>
<Setting1 />
{isMobile ? (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

얘는 제가 사이트 계정을 몰라서 들어가서 보지는 못했네요ㅠㅠ
만약 모바일에서만 보이는 것이라면 &&를 써서 표현하는 것도 좋을 것 같아요.
아니면 모바일과 웹이 아주 많이 다르다면 아예 컴포넌트를 따로 파서 조건부 렌더링을 해주는 것도 나쁘지 않은 방법이라고 생각합니다~ ( 이건 추후 상세한 개발 시에 고려해주세요~)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

모바일과 데스크탑의 헤더가 다르기 때문에 이렇게 작성하였습니다..!

<div>
<ul>
<div className={styles['menu-container']}>
{/* 월간조회 기능 추가 시 활성화 */}
{/* <SearchIcon className={styles.search} /> */}
Comment on lines +24 to +25
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 다음 기획에 예정되어있는 기능인가요?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 맞습니다!

<button
type="button"
onClick={setView}
className={styles['menu-icon']}
style={{ position: 'relative' }}
aria-label="메뉴 버튼"
>
<Menu className={styles.menu} />
</button>
<MobileDropdown view={view} />
</div>
</ul>
<Link to="/setting" />
</div>
) : (
<HeaderNavigation />
)}
</nav>
</header>
);
Expand Down
Loading
Loading