@@ -2,29 +2,19 @@ package com.ninecraft.booket.feature.detail.book.component
22
33import androidx.compose.foundation.layout.Arrangement
44import androidx.compose.foundation.layout.PaddingValues
5- import androidx.compose.foundation.layout.Row
65import androidx.compose.foundation.layout.Spacer
76import androidx.compose.foundation.layout.fillMaxWidth
87import androidx.compose.foundation.layout.height
98import androidx.compose.foundation.layout.padding
10- import androidx.compose.foundation.layout.width
119import androidx.compose.foundation.lazy.LazyColumn
12- import androidx.compose.material3.Icon
13- import androidx.compose.material3.Text
1410import androidx.compose.runtime.Composable
15- import androidx.compose.ui.Alignment
1611import androidx.compose.ui.Modifier
17- import androidx.compose.ui.graphics.vector.ImageVector
18- import androidx.compose.ui.res.stringResource
19- import androidx.compose.ui.res.vectorResource
12+ import androidx.compose.ui.unit.dp
2013import com.ninecraft.booket.core.designsystem.ComponentPreview
2114import com.ninecraft.booket.core.designsystem.theme.ReedTheme
22- import com.ninecraft.booket.feature.detail.R
23- import com.ninecraft.booket.core.designsystem.R as designR
2415import com.ninecraft.booket.feature.detail.book.BookDetailUiState
2516import kotlinx.collections.immutable.toImmutableList
2617
27- // TODO 필요한 파라미터만 선언하여 사용
2818@Composable
2919internal fun RecordsCollection (
3020 state : BookDetailUiState ,
@@ -33,53 +23,28 @@ internal fun RecordsCollection(
3323 LazyColumn (
3424 modifier = modifier
3525 .fillMaxWidth()
36- .padding(horizontal = ReedTheme .spacing.spacing5),
26+ .padding(horizontal = ReedTheme .spacing.spacing5)
27+ .height((192 * state.recordCollections.size).dp + 40 .dp),
3728 contentPadding = PaddingValues (vertical = ReedTheme .spacing.spacing6),
3829 verticalArrangement = Arrangement .spacedBy(ReedTheme .spacing.spacing3),
30+ userScrollEnabled = false ,
3931 ) {
4032 item {
41- Row (
42- modifier = Modifier .fillMaxWidth(),
43- verticalAlignment = Alignment .CenterVertically ,
44- horizontalArrangement = Arrangement .SpaceBetween ,
45- ) {
46- Row {
47- Text (
48- text = stringResource(R .string.record_collection),
49- color = ReedTheme .colors.contentPrimary,
50- style = ReedTheme .typography.headline2SemiBold,
51- )
52- Spacer (modifier = Modifier .width(ReedTheme .spacing.spacing1))
53- Text (
54- text = " ${state.recordCollections.size} " ,
55- color = ReedTheme .colors.contentPrimary,
56- style = ReedTheme .typography.headline2SemiBold,
57- )
58- }
59- Row {
60- Text (
61- text = stringResource(state.currentRecordSort.getDisplayNameRes()),
62- color = ReedTheme .colors.contentSecondary,
63- style = ReedTheme .typography.label1Medium,
64- )
65- Icon (
66- imageVector = ImageVector .vectorResource(designR.drawable.ic_chevron_down),
67- contentDescription = " Dropdown Icon" ,
68- )
69- }
70- }
33+ RecordsCollectionHeader (state = state)
7134 Spacer (modifier = Modifier .height(ReedTheme .spacing.spacing1))
7235 }
7336 items(
7437 count = state.recordCollections.size,
7538 key = { index -> state.recordCollections[index].id },
7639 ) { index ->
77- RecordItem (
78- quote = state.recordCollections[index].quote,
79- emotionTags = state.recordCollections[index].emotionTags.toImmutableList(),
80- pageNumber = state.recordCollections[index].pageNumber,
81- createdAt = state.recordCollections[index].createdAt,
82- )
40+ state.recordCollections[index].apply {
41+ RecordItem (
42+ quote = quote,
43+ emotionTags = emotionTags.toImmutableList(),
44+ pageNumber = pageNumber,
45+ createdAt = createdAt,
46+ )
47+ }
8348 }
8449 }
8550}
0 commit comments