-
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
홈 페이지 API 연동 #283
Merged
Merged
홈 페이지 API 연동 #283
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e534af6
Feat: 트렌딩 리스트 api 연결
Nahyun-Kang cfd4672
Feat: 이 주제로 만들어주세요 api 연결
Nahyun-Kang 5e7a0e7
Chore: 추천 리스트 css 파일명 변경
Nahyun-Kang d8fb58f
Fix: topic api 연동 type 수정 및 사용자 추천 로직 개선
Nahyun-Kang 00d7fcc
Feat: 검색바 구현
Nahyun-Kang b61b7ca
Merge branch 'dev' into Feat/home
Nahyun-Kang 60c0319
Style: 필요없는 코드 정리
Nahyun-Kang e1d1f5d
Fix: 코드리뷰 반영
Nahyun-Kang c1a32e0
Fix: 불필요한 Link 태그 제거
Nahyun-Kang 8f38332
Fix: ci 에러 해결
Nahyun-Kang 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
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
File renamed without changes.
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 |
---|---|---|
|
@@ -8,21 +8,19 @@ import { Swiper, SwiperSlide } from 'swiper/react'; | |
import 'swiper/css'; | ||
import { Autoplay, EffectCoverflow } from 'swiper/modules'; | ||
|
||
import getTrendingLists from '@/app/_api/home/getTrendingLists'; | ||
import getHomeRecommendedLists from '@/app/_api/home/getHomeRecommendedLists'; | ||
import { QUERY_KEYS } from '@/lib/constants/queryKeys'; | ||
import { TrendingListType } from '@/lib/types/exploreType'; | ||
import { TRENDINGLISTS_DATA } from '../mock/mockdata'; | ||
import { HomeRecommendedListType } from '@/lib/types/homeType'; | ||
|
||
import * as styles from './TrendingLists.css'; | ||
import * as styles from './HomeRecommendedLists.css'; | ||
import { vars } from '@/styles/theme.css'; | ||
import { TrendingListsSkeleton } from '../../../components/exploreComponents/Skeleton'; | ||
|
||
function TrendingList() { | ||
// 오류로인해 주석처리 해 둠 | ||
// const { data: trendingLists, isFetching } = useQuery({ | ||
// queryKey: [QUERY_KEYS.getTrendingLists], | ||
// queryFn: () => getTrendingLists(), | ||
// }); | ||
const { data: recommendedLists, isFetching } = useQuery({ | ||
queryKey: [QUERY_KEYS.getHomeRecommendedLists], | ||
queryFn: () => getHomeRecommendedLists(), | ||
}); | ||
|
||
const SWIPER_STYLE = useMemo( | ||
() => ({ | ||
|
@@ -48,7 +46,7 @@ function TrendingList() { | |
<section className={styles.wrapper}> | ||
<div className={styles.listWrapper}> | ||
<div className={styles.slide}> | ||
{TRENDINGLISTS_DATA && TRENDINGLISTS_DATA.length > 0 && ( | ||
{recommendedLists && recommendedLists.length > 0 && ( | ||
Comment on lines
43
to
+44
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. 한가지 궁금증이 혹시 추천리스트가 없을때는 무엇을 보여주는 것인가요?! 아니면 해당 API는 반드시 리스폰스(=리스트)가 존재하나요?! 👀 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. 스켈레톤을 보여주어야 하는데 이 부분은 시간이 부족하여 작업을 하지 못했습니다 ㅠㅠ 추후 리팩토링 시 작업하겠습니다! |
||
<Swiper | ||
slidesPerView={'auto'} | ||
grabCursor={true} | ||
|
@@ -63,7 +61,7 @@ function TrendingList() { | |
className="mySwiper" | ||
style={SWIPER_STYLE} | ||
> | ||
{TRENDINGLISTS_DATA.map((item, index) => ( | ||
{recommendedLists.map((item, index) => ( | ||
<SwiperSlide key={index} className={styles.sliderItem} style={SWIPER_SLIDER_STYLE}> | ||
<TrendingListItem item={item} index={index} /> | ||
</SwiperSlide> | ||
|
@@ -77,7 +75,7 @@ function TrendingList() { | |
} | ||
|
||
interface TrendingListItemProps { | ||
item: any; | ||
item: HomeRecommendedListType; | ||
index: number; | ||
} | ||
|
||
|
@@ -116,7 +114,7 @@ function TrendingListItem({ item }: TrendingListItemProps) { | |
export default TrendingList; | ||
|
||
interface TrendingListInformationType { | ||
item?: TrendingListType; | ||
item?: HomeRecommendedListType; | ||
} | ||
|
||
function TrendingListInformation({ item }: TrendingListInformationType) { | ||
|
@@ -133,11 +131,12 @@ function TrendingListInformation({ item }: TrendingListInformationType) { | |
<p className={styles.listOwner}>{item.ownerNickname}</p> | ||
</div> | ||
<ul className={styles.top3Wrapper}> | ||
{item.top3.map((el, idx) => ( | ||
<li key={idx} className={item.itemImageUrl ? styles.top3ItemWithImage : styles.top3ItemNoImage}> | ||
{`${idx + 1}. ${el.title}`} | ||
</li> | ||
))} | ||
{item && | ||
item?.items?.map((el, idx) => ( | ||
<li key={idx} className={item.itemImageUrl ? styles.top3ItemWithImage : styles.top3ItemNoImage}> | ||
{`${idx + 1}. ${el.title}`} | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
|
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
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,35 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const wrapper = style({ | ||
width: '100%', | ||
|
||
display: 'flex', | ||
alignItems: 'center', | ||
}); | ||
|
||
export const inputWrapper = style({ | ||
width: '100%', | ||
|
||
display: 'flex', | ||
alignItems: 'center', | ||
}); | ||
|
||
export const input = style({ | ||
width: '100%', | ||
|
||
fontSize: '1.6rem', | ||
overflow: 'hidden', | ||
'::placeholder': { | ||
color: '#637587', | ||
fontWeight: '400', | ||
fontSize: '1.6rem', | ||
}, | ||
}); | ||
|
||
export const cancelButton = style({ | ||
flexShrink: 0, | ||
fontWeight: '400', | ||
fontSize: '1.6rem', | ||
letterSpacing: '-3%', | ||
color: '#213752', | ||
}); |
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,21 @@ | ||
import * as styles from './SearchBarArea.css'; | ||
import SearchBar from '@/components/SearchBar'; | ||
|
||
interface SearchBarProps { | ||
handleCancel?: () => void; | ||
} | ||
|
||
function SearchBarArea({ handleCancel }: SearchBarProps) { | ||
return ( | ||
<div className={styles.wrapper}> | ||
<div className={styles.inputWrapper}> | ||
<SearchBar /> | ||
</div> | ||
<button className={styles.cancelButton} onClick={handleCancel}> | ||
취소 | ||
</button> | ||
</div> | ||
); | ||
} | ||
|
||
export default SearchBarArea; |
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
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
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.
나현님, 해당 파일은 3개의 컴포넌트로 구성되어 있는데 컨벤션을 조금 수정하면 좋을 것 같습니다. 👀