Skip to content

Commit

Permalink
[Feat] 밈 갯수 헤더 스크롤 가능하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
JaesungLeee committed Aug 17, 2024
1 parent 4de3873 commit 7db08f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import team.ppac.designsystem.component.toolbar.FarmemeBackToolBar
import team.ppac.search.detail.component.EmptyResultContent
import team.ppac.search.detail.component.SearchDetailLoadingContent
import team.ppac.search.detail.component.SearchDetailResultContent
import team.ppac.search.detail.component.SearchDetailResultHeader
import team.ppac.search.detail.mvi.SearchDetailUiState

@Composable
Expand Down Expand Up @@ -85,8 +84,8 @@ internal fun SearchDetailScreen(
if (uiState.totalMemeCount == 0) {
EmptyResultContent()
} else {
SearchDetailResultHeader(totalCount = uiState.totalMemeCount)
SearchDetailResultContent(
totalItemCount = uiState.totalMemeCount,
searchResults = searchResults,
onMemeClick = onMemeClick,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package team.ppac.search.detail.component

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.lazy.staggeredgrid.LazyVerticalStaggeredGrid
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells
import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridItemSpan
Expand All @@ -16,6 +17,7 @@ import team.ppac.search.detail.model.SearchResultUiModel
@Composable
fun SearchDetailResultContent(
modifier: Modifier = Modifier,
totalItemCount: Int,
searchResults: LazyPagingItems<SearchResultUiModel>,
onMemeClick: (String) -> Unit,
) {
Expand All @@ -25,6 +27,9 @@ fun SearchDetailResultContent(
horizontalArrangement = Arrangement.spacedBy(space = 12.dp),
verticalItemSpacing = 20.dp
) {
item(span = StaggeredGridItemSpan.FullLine) {
SearchDetailResultHeader(totalCount = totalItemCount)
}
items(
count = searchResults.itemCount,
key = searchResults.itemKey(SearchResultUiModel::memeId)
Expand All @@ -33,7 +38,7 @@ fun SearchDetailResultContent(

with(searchResult) {
FarmemeMemeItem(
modifier = Modifier,
modifier = Modifier.offset(y = (-20).dp),
memeId = memeId,
memeTitle = memeTitle,
lolCount = lolCount,
Expand Down

0 comments on commit 7db08f5

Please sign in to comment.