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 9 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: 1000;
JeongWon-CHO marked this conversation as resolved.
Show resolved Hide resolved
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;
}
26 changes: 26 additions & 0 deletions src/layout/Header/MobileDropdown.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Link } from 'react-router-dom';

import { useLogout } from 'query/auth';

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

function MobileDropdown() {
const { logout } = useLogout();

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

return (
<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>
);
}

export default MobileDropdown;
44 changes: 39 additions & 5 deletions src/layout/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,50 @@
import { useState } from 'react';

import { Link } from 'react-router-dom';

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

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

function Header() {
const { isMobile } = useMediaQuery();
const [view, setView] = useState(false);
JeongWon-CHO marked this conversation as resolved.
Show resolved Hide resolved

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((prev) => !prev)}
className={styles['menu-icon']}
style={{ position: 'relative' }}
aria-label="메뉴 버튼"
>
<Menu className={styles.menu} />
</button>
{view && <MobileDropdown />}
</div>
</ul>

<Link to="/setting" />
</div>
) : (
<div>
<Setting1 />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Setting1말고 더 적절한 네이밍은 없을까요?
코드만 보고 어떤 컴포넌트가 보여질지 잘 예상이 안가는것 같습니다

Copy link
Contributor

Choose a reason for hiding this comment

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

HeaderNavigation으로 변경하고 header 컴포넌트 하위로 해당 컴포넌트 위치 변경했습니다!

</div>
)}
</nav>
</header>
);
Expand Down
30 changes: 25 additions & 5 deletions src/pages/Coop/Coop.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

.container {
display: flex;
justify-content: center;
max-width: 989px;
width: 100%;
margin: 0 auto;
gap: 10px;

@include media.media-breakpoint-down(mobile) {
flex-direction: column;
max-width: 480px; // 모바일 뷰에서는 너비 제한
max-width: 100%;
width: 100%;
}
}
Expand All @@ -20,17 +22,35 @@

.content {
display: flex;
flex-grow: 2; // 2배 공간
flex-direction: column;
padding: 16px 24px;
gap: 12px;
width: 100%;

@include media.media-breakpoint-down(mobile) {
box-sizing: border-box;
}
}

.calendarWrapper {
flex-grow: 1; // 1:2 비율에서 1배의 공간
max-width: 989px;
display: flex;
gap: 10px;
justify-content: center;

@include media.media-breakpoint-down(mobile) {
flex-direction: column;
max-width: 480px;
width: 100%;
}
}

.diningTypeWrapper {
flex-grow: 2; // 1:2 비율에서 2배 공간
@include media.media-breakpoint-down(mobile) {
display: flex;
justify-content: center;
flex-direction: column;
margin: 0 auto;
max-width: 100%;
width: 100%;
}
}
Loading
Loading