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

[FEAT/#306] 3차 스프린트 탐색 뷰 #320

Merged
merged 11 commits into from
Jan 10, 2025
Merged

[FEAT/#306] 3차 스프린트 탐색 뷰 #320

merged 11 commits into from
Jan 10, 2025

Conversation

arinming
Copy link
Contributor

@arinming arinming commented Jan 4, 2025

⛳️ Work Description

  • 배너 API 연동
  • �좌우 스크롤 패딩 값 삭제
  • 네비게이션 로직 수정

📸 Screenshot

306.mp4

📢 To Reviewers

  • 너무 늦어서 죄송합니다 ㅠㅜ 더 늦었으면 코딩하는 법 까먹을 뻔..
  • 3차 스프린트에 기여를 많이 못해서 고맙구 미안해요.. ㅜㅜ!!

@arinming arinming added FEAT ✨ 새로운 기능 구현 아린💛 아린 labels Jan 4, 2025
@arinming arinming added this to the 3차 스프린트 작업 milestone Jan 4, 2025
@arinming arinming self-assigned this Jan 4, 2025
Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!!
혹시 배너 API 연결하는 코드는 어디서 확인할 수 있나요..?!
그리구 영상에 보이는 1월 4일 공사중이라는 배너는 올라가 있으면 안돼요..!! 이 배너 어디서 가져온건가용?

Comment on lines 41 to 46
fun SearchRoute(
modifier: Modifier,
paddingValues: PaddingValues,
viewModel: SearchViewModel = hiltViewModel(),
navigateToSearchProcess: () -> Unit,
navigateToIntern: (Long) -> Unit,
viewModel: SearchViewModel = hiltViewModel(),
) {
Copy link
Member

Choose a reason for hiding this comment

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

옵셔널한 값은 가장 아래로 오게 순서 수정 부탁드립니당

Comment on lines 39 to 42
modifier = Modifier
.padding(vertical = 12.dp),
horizontalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = androidx.compose.foundation.layout.PaddingValues(horizontal = 24.dp)
Copy link
Member

Choose a reason for hiding this comment

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

androidx.compose.foundation.layout는 임포트로 넣어주는 게 좋을 것 같아요!

Suggested change
modifier = Modifier
.padding(vertical = 12.dp),
horizontalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = androidx.compose.foundation.layout.PaddingValues(horizontal = 24.dp)
modifier = Modifier
.padding(vertical = 12.dp),
horizontalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(horizontal = 24.dp)

Copy link
Member

@Hyobeen-Park Hyobeen-Park left a comment

Choose a reason for hiding this comment

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

진짜 배너 연결 부분이 없네요!! 한번만 확인 부탁드립니다 :)

@@ -103,7 +104,7 @@ fun SearchRoute(

@Composable
fun SearchScreen(
modifier: Modifier = Modifier,
paddingValues: PaddingValues,
bannerList: List<com.terning.domain.search.entity.SearchBanner>,
Copy link
Member

Choose a reason for hiding this comment

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

오잉 근데 요기도 임포트가 안되어있네요🤔 이제 알았어요,,,

boiledEgg-s
boiledEgg-s previously approved these changes Jan 4, 2025
Copy link
Member

@boiledEgg-s boiledEgg-s left a comment

Choose a reason for hiding this comment

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

수고하셨습니당~ 배너 api는 아직 PR이 안올라온거 같은데 후딱 올려주세여!

@boiledEgg-s boiledEgg-s self-requested a review January 4, 2025 15:45
@boiledEgg-s boiledEgg-s dismissed their stale review January 4, 2025 15:46

머지 조건이 한명인지 몰랐음ㅎ

Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

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

수고하셨어요!!! 전에 달았던 코드리뷰랑 같이 확인 부탁드립니당

Comment on lines +49 to 51
val bannerState by viewModel.bannerState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner)
val viewState by viewModel.viewState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner)
val scrapState by viewModel.scrapState.collectAsStateWithLifecycle(lifecycleOwner = lifecycleOwner)
Copy link
Member

Choose a reason for hiding this comment

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

궁금해서 물어보는 건데요...! 혹시 bannerState를 따로 추가해준 이유가 있나용...?! state를 나누는 기준이 궁금해졌어요!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

배너 / 조회수 많은 공고 / 스크랩 많은 공고로 state를 나누었습니다!

Comment on lines 72 to 76
val bannerList = when (bannerState.searchBannersList) {
is UiState.Success -> (bannerState.searchBannersList as UiState.Success<List<com.terning.domain.search.entity.SearchBanner>>).data.toImmutableList()
else -> emptyList()
}

Copy link
Member

Choose a reason for hiding this comment

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

흠 그리고 feature에서 domain의 데이터클래스를 사용하는 거에 대해 괜찮을지에 대한 의문이 드네요..
feature에서 사용할 모델을 따로 만들어 주는 건 어떤가요.....?

Suggested change
val bannerList = when (bannerState.searchBannersList) {
is UiState.Success -> (bannerState.searchBannersList as UiState.Success<List<com.terning.domain.search.entity.SearchBanner>>).data.toImmutableList()
else -> emptyList()
}
val bannerList = when (bannerState.searchBannersList) {
is UiState.Success -> (bannerState.searchBannersList as UiState.Success<List<SearchBanner>>).data.toImmutableList()
else -> emptyList()
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

헉 감사해욤 feature에 있는 모델 State로 변경했습니다

Comment on lines 38 to 40
private val _bannerList: MutableStateFlow<List<com.terning.domain.search.entity.SearchBanner>> =
MutableStateFlow(emptyList())

Copy link
Member

Choose a reason for hiding this comment

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

여기도 임포트 수정 부탁드립니다!

Comment on lines 82 to 83
_sideEffect.emit(SearchSideEffect.Toast(R.string.server_failure))
}
Copy link
Member

Choose a reason for hiding this comment

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

엇 제가 여기는 수정을 못한 것 같네요..! 서버통신 성공여부 문구는 designsystem의 R클래스를 공통으로 사용하면 통일성 있을 것 같습니당,,!

Comment on lines 30 to 31
searchBanners: List<SearchBanner>,
onAdvertisementClick: (Int) -> Unit,
Copy link
Member

Choose a reason for hiding this comment

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

저희 List는 ImmutableList로 수정해주면 감사하겠습니다🙇‍♀️

Suggested change
searchBanners: List<SearchBanner>,
onAdvertisementClick: (Int) -> Unit,
searchBanners: ImmutableList<SearchBanner>,
onAdvertisementClick: (Int) -> Unit,

Comment on lines 62 to 78
HorizontalPager(
state = pagerState,
modifier = modifier,
beyondViewportPageCount = 1
) { currentPage ->
val pageIndex = currentPage % searchBanners.size
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(searchBanners[pageIndex].imageUrl)
.crossfade(true)
.build(),
contentDescription = null,
modifier = modifier
.fillMaxWidth()
.height(112.dp)
.noRippleClickable { onAdvertisementClick(pageIndex) },
contentScale = ContentScale.Crop,
Copy link
Member

Choose a reason for hiding this comment

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

여기 두 부분 모두 Modifier로 바꿔줘야 할 것 같아요,,!!

Suggested change
HorizontalPager(
state = pagerState,
modifier = modifier,
beyondViewportPageCount = 1
) { currentPage ->
val pageIndex = currentPage % searchBanners.size
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(searchBanners[pageIndex].imageUrl)
.crossfade(true)
.build(),
contentDescription = null,
modifier = modifier
.fillMaxWidth()
.height(112.dp)
.noRippleClickable { onAdvertisementClick(pageIndex) },
contentScale = ContentScale.Crop,
HorizontalPager(
state = pagerState,
modifier = Modifier,
beyondViewportPageCount = 1
) { currentPage ->
val pageIndex = currentPage % searchBanners.size
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data(searchBanners[pageIndex].imageUrl)
.crossfade(true)
.build(),
contentDescription = null,
modifier = Modifier
.fillMaxWidth()
.height(112.dp)
.noRippleClickable { onAdvertisementClick(pageIndex) },
contentScale = ContentScale.Crop,

@arinming arinming requested a review from leeeyubin January 10, 2025 01:05
Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

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

확인했습니다! 아직 페이징 처리가 안되어있어서 이 부분만 추가로 마무리 해주시면 감사하겠습니다!!

Comment on lines +45 to +48
override suspend fun getSearchBannersList(): Result<List<SearchBanner>> =
kotlin.runCatching {
searchDataSource.getSearchBanners().result.toSearchBannerList()
}
Copy link
Member

Choose a reason for hiding this comment

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

이거 이제 봤는데 kotlin 지워줘야 할 것 같아요!

Suggested change
override suspend fun getSearchBannersList(): Result<List<SearchBanner>> =
kotlin.runCatching {
searchDataSource.getSearchBanners().result.toSearchBannerList()
}
override suspend fun getSearchBannersList(): Result<List<SearchBanner>> =
runCatching {
searchDataSource.getSearchBanners().result.toSearchBannerList()
}

Comment on lines 70 to 75
viewModel.getSearchList(
keyword = state.text,
page = 0,
size = 0
size = 100
)
}
Copy link
Member

Choose a reason for hiding this comment

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

혹시 여기 100으로 해준 이유가 있나요..?
제가 알기론 이 부분 페이징 처리해줘야 된다고 알고 있는데 아마 10개씩 불러와야 할 거에요!

@arinming arinming merged commit 86e087f into develop Jan 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEAT ✨ 새로운 기능 구현 아린💛 아린
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[FEAT] 3차 스프린트 탐색 뷰
4 participants