-
Notifications
You must be signed in to change notification settings - Fork 6
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
Feat: 리스트 상세페이지 안쪽 레이아웃 퍼블리싱 #15
Merged
kanglocal
merged 46 commits into
8-Sprinters:dev
from
kanglocal:feature/list_detail_component
Feb 5, 2024
Merged
Changes from 42 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
91eb607
Design : 리스트 상세페이지 내부의 rankList 컴포넌트 레이아웃 생성
kanglocal 918ec84
Design : 리스트 상세페이지 내부의 rankList 컴포넌트 스타일 적용
kanglocal 9f031bf
Fix : 리스트 상세페이지 내부의 rankList 컴포넌트 스타일 및 타입 수정
kanglocal 6c70a71
Design : 리스트 상세페이지 내부의 rankList 컴포넌트 스타일 수정
kanglocal 03328bf
Design : 리스트 상세페이지 내부의 rankList 컴포넌트에 바텀시트 추가
kanglocal 5260285
Chore : open-graph 라이브러리 설치
kanglocal ceca2ea
Chore : open-graph 라이브러리 타입 설치
kanglocal b89db45
Chore : cheerio 라이브러리 설치
kanglocal 7fde5f0
feat : 링크 미리보기 기능 일부 구현
kanglocal 08b9252
style : 링크 미리보기 코드 수정
kanglocal 292fbf7
Design : rankList 스타일 변경
kanglocal 250b759
Feature : 비디오 임베드 추가 및 스타일 변경
kanglocal 4723e2e
Style : 주석 수정
kanglocal f31b0b7
Chore : copy-to-clipboard 라이브러리 다운로드
kanglocal 20971db
Feature : 링크 다운로드 기능 구현
kanglocal dea6474
Chore : react-toastify 다운로드
kanglocal 3fcbad3
Feature : 토스트 구현
kanglocal da2e056
Chore : html-to-image 라이브러리 다운로드
kanglocal aaa72c6
Feature : 리스트상세의 이미지 저장 기능 구현 초안
kanglocal 6da3a8c
Feature : 카카오톡 공유기 초안
kanglocal f7b372a
Feature : OG태그 불러오는 로직을 프록시로 이동
kanglocal 8d60c1f
Fix : 목데이터 제거 및 코드 정리
kanglocal d5687d0
Fix : 프록시 설정
kanglocal 668609c
Fix : 컴포넌트명 변경
kanglocal 6101a8a
Fix : 컴포넌트명 변경
kanglocal 1fb34c0
Style : css파일 컨벤션에 맞춰 수정 및 폴더 구조 변경
kanglocal 332575e
fix : layout.tsx에 카카오 sdk, toastContainer 추가
kanglocal eaa8444
fix : 카카오톡 공유 템플릿 변경
kanglocal 30d5a43
fix : 링크 미리보기 수정
kanglocal c3a2490
Design : rankList css 수정
kanglocal 2685880
fix : img태그 -> Image로 수정
kanglocal 2bd4c0c
Chore : yarn.lock 커밋
kanglocal 584b6f1
fix : img태그 -> Image태그
kanglocal 20b7633
fix : 사용하지 않는 파일 삭제
kanglocal eba8ed8
Merge remote-tracking branch 'upstream/dev' into feature/list_detail_…
kanglocal b7794b3
fix : Image -> img
kanglocal 6430315
Design : 나현님 css에맞춰 수정
kanglocal f39effc
Merge remote-tracking branch 'upstream/dev' into feature/list_detail_…
kanglocal 37b1606
Style : 불필요한 console.log 삭제
kanglocal e33c35c
Style : import 순서 변경
kanglocal 89aa080
Style : CI/CD에서 잡아준 에러로 수정했습니다.
kanglocal c90d561
Style : TODO 주석 생성
kanglocal 5a3b3a8
Style : CI/CD 에러 수정
kanglocal 4627d2d
Style : 오타 수정
kanglocal dec085b
Style : TODO 주석 생성
kanglocal 0462dd3
Style : CI/CD에러 수정
kanglocal 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 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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions
74
src/app/[userNickname]/[listId]/_components/BottomSheet/BottomSheet.css.tsx
This file contains 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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { keyframes, style } from '@vanilla-extract/css'; | ||
|
||
export const backGround = style({ | ||
position: 'fixed', | ||
top: 0, | ||
left: 0, | ||
bottom: 0, | ||
right: 0, | ||
background: 'rgba(0,0,0,0.3)', | ||
zIndex: 999, | ||
}); | ||
|
||
export const wrapper = style({ | ||
padding: '37px 0 43px', | ||
|
||
position: 'fixed', | ||
bottom: 0, | ||
left: 0, | ||
right: 0, | ||
|
||
display: 'flex', | ||
flexDirection: 'column', | ||
justifyContent: 'center', | ||
|
||
backgroundColor: '#ffffff', | ||
borderTopLeftRadius: '25px', | ||
borderTopRightRadius: '25px', | ||
|
||
transitionProperty: 'all', | ||
transitionDuration: '0.2s', | ||
}); | ||
|
||
const slideIn = keyframes({ | ||
from: { transform: 'translateY(100%)' }, | ||
to: { transform: 'translateY(0)' }, | ||
}); | ||
|
||
export const sheetActive = style({ | ||
animation: `${slideIn} 0.2s ease-in-out`, | ||
}); | ||
|
||
export const sheetItemWrapper = style({ | ||
display: 'flex', | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
|
||
':hover': { | ||
backgroundColor: '#EFEFF0', | ||
}, | ||
}); | ||
|
||
export const checkIcon = style({ | ||
display: 'none', | ||
marginRight: '28px', | ||
|
||
selectors: { | ||
[`${sheetItemWrapper}:hover &`]: { | ||
display: 'block', | ||
}, | ||
}, | ||
}); | ||
|
||
export const sheetItem = style({ | ||
width: '100%', | ||
fontSize: '1.4rem', | ||
cursor: 'pointer', | ||
padding: '2.5rem 2.8rem 2.5rem', | ||
|
||
selectors: { | ||
[`${sheetItemWrapper}:hover &`]: { | ||
color: '#FF5454', | ||
}, | ||
}, | ||
}); |
23 changes: 23 additions & 0 deletions
23
src/app/[userNickname]/[listId]/_components/ListDetailInner/Footer.css.ts
This file contains 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const container = style({ | ||
width: '100%', | ||
|
||
display: 'flex', | ||
justifyContent: 'space-between', | ||
alignItems: 'center', | ||
}); | ||
|
||
export const shareAndOthers = style({ | ||
width: '100%', | ||
|
||
display: 'flex', | ||
flexDirection: 'row', | ||
justifyContent: 'right', | ||
alignItems: 'center', | ||
gap: '20px', | ||
}); | ||
|
||
export const buttonComponent = style({ | ||
cursor: 'pointer', | ||
}); |
143 changes: 143 additions & 0 deletions
143
src/app/[userNickname]/[listId]/_components/ListDetailInner/Footer.tsx
This file contains 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 |
---|---|---|
@@ -0,0 +1,143 @@ | ||
'use client'; | ||
|
||
import { useParams, useRouter } from 'next/navigation'; | ||
import { MouseEvent, useState } from 'react'; | ||
import BottomSheet from '@/app/[userNickname]/[listId]/_components/BottomSheet/BottomSheet'; | ||
import ModalPortal from '@/components/ModalPortal'; | ||
import saveImageFromHtml from '@/lib/utils/saveImageFromHtml'; | ||
import copyUrl from '@/lib/utils/copyUrl'; | ||
import toasting from '@/lib/utils/toasting'; | ||
import kakaotalkShare from '@/components/KakaotalkShare/kakaotalkShare'; | ||
import * as styles from './Footer.css'; | ||
import CollectIcon from '/public/icons/collect.svg'; | ||
import ShareIcon from '/public/icons/share.svg'; | ||
import EtcIcon from '/public/icons/etc.svg'; | ||
|
||
interface BottomSheetOptionsProps { | ||
key: string; | ||
title: string; | ||
onClick: () => void; | ||
} | ||
|
||
interface SheetTypeProps { | ||
type: 'share' | 'etc'; | ||
} | ||
|
||
interface FooterProps { | ||
category: string; | ||
listId: string; | ||
title: string; | ||
description: string; | ||
items: []; | ||
collaborators: []; | ||
ownerNickname: string; | ||
} | ||
|
||
function Footer({ data }: { data: FooterProps }) { | ||
const router = useRouter(); | ||
const params = useParams<{ userNickname: string; listId: string }>(); | ||
|
||
const [isSheetActive, setSheetActive] = useState<boolean>(false); | ||
const [sheetOptionList, setSheetOptionList] = useState<BottomSheetOptionsProps[]>([]); | ||
|
||
const handleSheetOptionList = ({ type }: SheetTypeProps) => { | ||
const listUrl = `${process.env.NEXT_PUBLIC_BASE_URL}/${params?.userNickname}/${params?.listId}`; | ||
|
||
if (type === 'share') { | ||
const optionList = [ | ||
{ | ||
key: 'copyLink', | ||
title: '리스트 링크 복사하기', | ||
onClick: () => { | ||
copyUrl(listUrl); | ||
setSheetActive(false); | ||
}, | ||
}, | ||
{ | ||
key: 'kakaoShare', | ||
title: '리스트 카카오톡으로 공유하기', | ||
onClick: () => { | ||
// TODO: image로 저장한다음에 해당 image를 보내줘야한다. | ||
kakaotalkShare({ | ||
title: data.title, | ||
description: data.description, | ||
image: | ||
'https://i.namu.wiki/i/-8Iah6PGZzzQuY1KtJIbj8_KBbX4whnbaq8AYShoqphdJOpfJDskZZ2Y3bU2I5Jpnx8aRi1LXTz1_e0v_fMrp172modjOmKRcxcME5dmM6IDAIgqktw5yIs75is2CgC1GrGoxZPwxpeTXudKIxWn2w.webp', | ||
listItem: data.items, | ||
collaborators: data.collaborators, | ||
listId: data.listId, | ||
userNickname: data.ownerNickname, | ||
}); | ||
setSheetActive(false); | ||
}, | ||
}, | ||
]; | ||
setSheetOptionList([...optionList]); | ||
return; | ||
} | ||
Comment on lines
+76
to
+77
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. if문-fast 리턴 패턴 너무 편안하고 좋아요 ㅎㅎ |
||
|
||
if (type === 'etc') { | ||
const optionList = [ | ||
{ | ||
key: 'saveToImg', | ||
title: '리스트 이미지로 저장하기', | ||
onClick: () => { | ||
setSheetActive(false); | ||
saveImageFromHtml({ filename: `${data.category}_${data.listId}` }); | ||
}, | ||
}, | ||
{ | ||
key: 'copyAndCreateList', | ||
title: '이 리스트 템플릿으로 바로 리스트 작성하기', | ||
onClick: () => { | ||
toasting({ type: 'default', txt: '리스트 작성 페이지로 이동합니다.' }); | ||
router.push(`/create?title=${data.title}&category=${data.category}`); | ||
}, | ||
}, | ||
]; | ||
setSheetOptionList([...optionList]); | ||
return; | ||
} | ||
}; | ||
|
||
const handleSheetActive = ({ type }: SheetTypeProps) => { | ||
handleSheetOptionList({ type }); | ||
setSheetActive((prev: boolean) => !prev); | ||
}; | ||
|
||
const handleOutsideClick = (e: MouseEvent) => { | ||
if (e.target === e.currentTarget) { | ||
setSheetActive(false); | ||
} | ||
}; | ||
|
||
// TODO: 콜렉트 API생성되면 요청보내고 UI변경시키기 | ||
const handleCollect = () => { | ||
console.log('콜렉트기능 미구현'); | ||
}; | ||
|
||
return ( | ||
<> | ||
{isSheetActive && ( | ||
<ModalPortal> | ||
<BottomSheet onClose={handleOutsideClick} isActive={isSheetActive} optionList={sheetOptionList} /> | ||
</ModalPortal> | ||
)} | ||
<div className={styles.container}> | ||
<div className={styles.buttonComponent}> | ||
<CollectIcon onClick={handleCollect} /> | ||
</div> | ||
<div className={styles.shareAndOthers}> | ||
<div className={styles.buttonComponent} onClick={() => handleSheetActive({ type: 'share' })}> | ||
<ShareIcon /> | ||
</div> | ||
<div className={styles.buttonComponent} onClick={() => handleSheetActive({ type: 'etc' })}> | ||
<EtcIcon /> | ||
</div> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} | ||
|
||
export default Footer; |
9 changes: 9 additions & 0 deletions
9
src/app/[userNickname]/[listId]/_components/ListDetailInner/Header.css.ts
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const container = style({ | ||
width: '100%', | ||
|
||
display: 'flex', | ||
justifyContent: 'right', | ||
alignItems: 'center', | ||
}); |
31 changes: 31 additions & 0 deletions
31
src/app/[userNickname]/[listId]/_components/ListDetailInner/Header.tsx
This file contains 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import * as styles from './Header.css'; | ||
import SelectComponent from '@/components/SelectComponent/SelectComponent'; | ||
|
||
interface OptionsProps { | ||
value: string; | ||
label: string; | ||
} | ||
|
||
interface HeaderProps { | ||
handleChangeListType: (target: OptionsProps) => void | undefined; | ||
} | ||
|
||
const dropdownOptions = [ | ||
{ | ||
value: 'simple', | ||
label: '간단히', | ||
}, | ||
{ | ||
value: 'detail', | ||
label: '자세히', | ||
}, | ||
]; | ||
function Header({ handleChangeListType }: HeaderProps) { | ||
return ( | ||
<div className={styles.container}> | ||
<SelectComponent name="listType" options={dropdownOptions} isSearchable={false} onChange={handleChangeListType} /> | ||
</div> | ||
); | ||
} | ||
|
||
export default Header; |
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.
바닐라익스트랙 keyframe 이렇게 쓰는거였군요,,!!!
왜인지 제 드롭다운은 스르륵이 적용 안 됐는데 이제야 이유를 알아갑니다,,🩷
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.
나현님께서 구현하신 부분입니다!!! 컨플릭트 없애려고 전전긍긍하다보니 제꺼로 들어와버렸네요...ㅠㅠㅠㅠㅠ
나현님최고!