-
Notifications
You must be signed in to change notification settings - Fork 3
feat: 모바일 마이페이지 구현 #311
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
Open
WonJuneKim
wants to merge
44
commits into
dev
Choose a base branch
from
feat/273-balancegame-mobile-api
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: 모바일 마이페이지 구현 #311
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
a736e0a
feat: 모바일 마이페이지에서 사용하는 타입을 추가합니다.
WonJuneKim c7bcc8f
refactor: 버튼의 객체를 컴포넌트 외부에 선언합니다.
WonJuneKim 6c7b9cd
refactor: 무한 스크롤 커스텀 훅에 option을 오버라이딩할 수 있도록 매개변수를 추가합니다.
WonJuneKim 0dbcf7a
refactor: 커스텀 훅이 option을 오버라이딩 하고, 데이터 형태 그대로를 반환하도록 수정합니다.
WonJuneKim 04679d4
feat: 모바일 마이페이지의 스타일을 추가합니다.
WonJuneKim 7fb32b3
move: 불필요한 주석을 제거합니다.
WonJuneKim 1a83cfd
feat: 모바일 밸런스게임 카드의 organisms을 구현합니다.
WonJuneKim 5ffe6ff
feat: 스토리북에서 이미지를 테스트하기 위한 샘플 이미지를 추가합니다.
WonJuneKim 3d2276e
docs: DateGroupedCard 컴포넌트의 스토리북을 추가합니다.
WonJuneKim f24481c
refactor: ContentsButton의 image props을 옵셔널로 수정합니다.
WonJuneKim e5c20fe
feat: 마이페이지 인터페이스에 imgUrl을 옵셔널로 추가 선언 후 정렬합니다.
WonJuneKim 34cbd2f
feat: 모바일 마이페이지에 데이터 패칭을 수행하여 구현합니다.
WonJuneKim 2350358
feat: LayoutNoFooter의 모바일 분기점을 설정합니다.
WonJuneKim 8d35ec9
refactor: 마이페이지의 레이아웃 분기점을 재설정합니다.
WonJuneKim 9349cc0
refactor: 마이페이지에서 사용하는 인터페이스를 api response에 맞게 재설정합니다.
WonJuneKim 17d0b7a
feat: 모바일 마이페이지 레이아웃을 위한 추가 스타일을 생성합니다.
WonJuneKim 5d58724
feat: 데이터가 렌더링 되는 부분에 gap을 추가합니다.
WonJuneKim 90a1867
move: 불필요한 콘솔을 제거합니다.
WonJuneKim 276ff20
move: 사용되지 않는 문구를 제거합니다.
WonJuneKim 8c2a752
refactor: images 값이 존재하지 않거나, 두 값이 쌍으로 존재하지 않을 때 빈 배열을 반환합니다.
WonJuneKim 779179a
move: 요구사항이 아닌 기본 값을 제거합니다.
WonJuneKim 3bdeaa2
refactor: 북마크 아이콘 표기 상태를 activeButton의 state로 분기합니다.
WonJuneKim a4030a4
refactor: useEffect의 의존성 배열안에 activeButton 을 추가합니다.
WonJuneKim e973e44
refactor: MenuItem의 props 구조를 ReactNode를 이용해 확장합니다.
WonJuneKim 08bbc3a
docs: 수정된 props를 스토리 파일에 반영합니다.
WonJuneKim 793a3c5
refactor: 수정된 MenuTap 구조를 적용합니다.
WonJuneKim 4a95bfe
design: label의 길이가 길어져도 길이가 확장되는 구조로 변경합니다.
WonJuneKim 4ea14f7
feat: 마이페이지에 사용하는 svg 파일을 추가합니다.
WonJuneKim 4d3afbc
refactor: 수정된 menuData의 데이터 타입에 맞춰 props를 변경합니다.
WonJuneKim 3325618
feat: 회원정보 수정 메뉴와 스타일을 추가합니다.
WonJuneKim 392ab1f
feat: menuData 이동 시 상수화된 경로를 사용합니다.
WonJuneKim e8f1eeb
feat: 모바일 톡픽 컴포넌트에 클릭 핸들러를 추가합니다.
WonJuneKim fa8819d
feat: 밸런스 게임 아이디 가공 시 onClick 요소를 추가합니다.
WonJuneKim dd9906f
feat: imgUrl이 존재하지 않을 때 랜덤 이미지가 출력 기능을 추가합니다.
WonJuneKim db250de
refactor: 컴포넌트의 최상우 태그를 Link로 변경합니다.
WonJuneKim ef1789c
docs: 컴포넌트의 태그 변경 사항에 맞춰 스토리북 항목을 추가합니다.
WonJuneKim 72953d8
refactor: 하위 컴포넌트의 태그 변경 사항에 맞춰 이벤트 핸들러를 제거합니다.
WonJuneKim 93520b2
refactor: 톡픽의 imgUrl이 존재하지 않는 경우 빈 값을 보냅니다.
WonJuneKim 625a187
feat: 북마크 커스텀 훅을 모바일 마이페이지에 적용합니다.
WonJuneKim 79a4469
design: observer의 스타일을 선언합니다.
WonJuneKim 0023910
feat: UseEffect의 의존성 배열에 영향을 주는 값을 추가합니다.
WonJuneKim beb1098
refactor: 옵셔널 체이닝을 사용하여 조건문을 간결하게 수정합니다.
WonJuneKim a520bb2
refactor: 널 병합 연산자를 사용해 falsy한 값을 보장합니다.
WonJuneKim ef01709
refactor: imgUrl이 없을 땐 undefined로 명시적 반환을 합니다.
WonJuneKim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,39 @@ | ||
| import { css } from '@emotion/react'; | ||
| import color from '@/styles/color'; | ||
| import typo from '@/styles/typo'; | ||
|
|
||
| export const menuTapStyling = css({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| alignItems: 'flex-end', | ||
| }); | ||
|
|
||
| export const menuIconStlying = css({ | ||
| width: '11px', | ||
| height: '17px', | ||
| cursor: 'pointer', | ||
| }); | ||
|
|
||
| export const menuStlying = css({ | ||
| position: 'absolute', | ||
| marginTop: '23px', | ||
| marginRight: '4px', | ||
| width: '86px', | ||
| backgroundColor: color.WT, | ||
| border: `1px solid ${color.GY[2]}`, | ||
| borderRadius: '10px', | ||
| overflow: 'hidden', | ||
| boxShadow: '1px 2px 10px rgba(0, 0, 0, 0.07)', | ||
| }); | ||
|
|
||
| export const menuItemStyling = css(typo.Comment.SemiBold, { | ||
| width: '100%', | ||
| padding: '10px', | ||
| cursor: 'pointer', | ||
| color: color.BK, | ||
| borderBottom: `1px solid ${color.GY[2]}`, | ||
| ':last-child': { | ||
| borderBottom: 'none', | ||
| }, | ||
| }); | ||
| import { css } from '@emotion/react'; | ||
| import color from '@/styles/color'; | ||
| import typo from '@/styles/typo'; | ||
|
|
||
| export const menuTapStyling = css({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| alignItems: 'flex-end', | ||
| }); | ||
|
|
||
| export const menuIconStlying = css({ | ||
| width: '11px', | ||
| height: '17px', | ||
| cursor: 'pointer', | ||
| }); | ||
|
|
||
| export const menuStlying = css({ | ||
| position: 'absolute', | ||
| marginTop: '23px', | ||
| marginRight: '4px', | ||
| minWidth: '86px', | ||
| width: 'max-content', | ||
| backgroundColor: color.WT, | ||
| border: `1px solid ${color.GY[2]}`, | ||
| borderRadius: '10px', | ||
| overflow: 'hidden', | ||
| boxShadow: '1px 2px 10px rgba(0, 0, 0, 0.07)', | ||
| }); | ||
|
|
||
| export const menuItemStyling = css(typo.Comment.SemiBold, { | ||
| width: '100%', | ||
| padding: '10px', | ||
| cursor: 'pointer', | ||
| color: color.BK, | ||
| borderBottom: `1px solid ${color.GY[2]}`, | ||
| ':last-child': { | ||
| borderBottom: 'none', | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,59 +1,60 @@ | ||
| import React, { useState, useEffect } from 'react'; | ||
| import { Menu } from '@/assets'; | ||
| import { | ||
| menuIconStlying, | ||
| menuItemStyling, | ||
| menuStlying, | ||
| menuTapStyling, | ||
| } from './MenuTap.style'; | ||
|
|
||
| export type MenuItem = { | ||
| label?: string; | ||
| onClick?: () => void; | ||
| }; | ||
|
|
||
| export interface MenuTapProps { | ||
| menuData: MenuItem[]; | ||
| } | ||
|
|
||
| const MenuTap = ({ menuData }: MenuTapProps) => { | ||
| const [view, setView] = useState<boolean>(false); | ||
|
|
||
| const handleMenuClick = (e: React.MouseEvent) => { | ||
| e.stopPropagation(); | ||
| setView(!view); | ||
| }; | ||
|
|
||
| const handleOutsideClick = () => { | ||
| setView(false); | ||
| }; | ||
|
|
||
| useEffect(() => { | ||
| window.addEventListener('click', handleOutsideClick); | ||
| return () => { | ||
| window.removeEventListener('click', handleOutsideClick); | ||
| }; | ||
| }, []); | ||
|
|
||
| return ( | ||
| <div css={menuTapStyling}> | ||
| <Menu css={menuIconStlying} onClick={handleMenuClick} /> | ||
| {view && ( | ||
| <div css={menuStlying}> | ||
| {menuData.map((item) => ( | ||
| <button | ||
| type="button" | ||
| key={item.label} | ||
| css={menuItemStyling} | ||
| onClick={item?.onClick} | ||
| > | ||
| {item.label} | ||
| </button> | ||
| ))} | ||
| </div> | ||
| )} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default MenuTap; | ||
| import React, { useState, useEffect, ReactNode } from 'react'; | ||
| import { Menu } from '@/assets'; | ||
| import { | ||
| menuIconStlying, | ||
| menuItemStyling, | ||
| menuStlying, | ||
| menuTapStyling, | ||
| } from './MenuTap.style'; | ||
|
|
||
| export type MenuItem = { | ||
| id: number; | ||
| label?: ReactNode; | ||
| onClick?: () => void; | ||
| }; | ||
|
|
||
| export interface MenuTapProps { | ||
| menuData: MenuItem[]; | ||
| } | ||
|
|
||
| const MenuTap = ({ menuData }: MenuTapProps) => { | ||
|
Comment on lines
+19
to
+20
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 스토리북으로 확인해보니 글자 수가 같아도 메뉴가 1개일 때와 2개일 때의 width 길이가 차이가 나는 것 같아요!! 스타일 확인 부탁드립니닷 |
||
| const [view, setView] = useState<boolean>(false); | ||
|
|
||
| const handleMenuClick = (e: React.MouseEvent) => { | ||
| e.stopPropagation(); | ||
| setView(!view); | ||
| }; | ||
|
|
||
| const handleOutsideClick = () => { | ||
| setView(false); | ||
| }; | ||
|
|
||
| useEffect(() => { | ||
| window.addEventListener('click', handleOutsideClick); | ||
| return () => { | ||
| window.removeEventListener('click', handleOutsideClick); | ||
| }; | ||
| }, []); | ||
|
|
||
| return ( | ||
| <div css={menuTapStyling}> | ||
| <Menu css={menuIconStlying} onClick={handleMenuClick} /> | ||
| {view && ( | ||
| <div css={menuStlying}> | ||
| {menuData.map((item) => ( | ||
| <button | ||
| type="button" | ||
| key={item.id} | ||
| css={menuItemStyling} | ||
| onClick={item?.onClick} | ||
| > | ||
| {item.label} | ||
| </button> | ||
| ))} | ||
| </div> | ||
| )} | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default MenuTap; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
현재 구현된 방식도 괜찮은 것 같습니다!! 👍