Skip to content

Commit

Permalink
feat : 카운트 다운 노출 기준 및 간격 조정
Browse files Browse the repository at this point in the history
  • Loading branch information
HamBP committed Nov 14, 2024
1 parent 037938d commit 787b12b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal data class ShowDetailResponse(
detailAddress = detailAddress,
notice = notice,
salesStartDate = salesStartTime.toLocalDate(),
salesEndDate = salesEndTime.toLocalDate(),
salesEndDateTime = salesEndTime.toLocalDateTime(),
images = showImg.toDomains(),
hostName = hostName,
hostPhoneNumber = hostPhoneNumber,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ data class ShowDetail(
val detailAddress: String = "",
val notice: String = "",
val salesStartDate: LocalDate = LocalDate.now(),
val salesEndDate: LocalDate = LocalDate.now(),
val salesEndDateTime: LocalDateTime = LocalDateTime.now(),
val images: List<ImagePair> = emptyList(),
val hostName: String = "",
val hostPhoneNumber: String = "",
Expand All @@ -27,8 +27,8 @@ data class ShowDetail(
return when {
now > date.toLocalDate() -> ShowState.FinishedShow
now < salesStartDate -> ShowState.WaitingTicketing(salesStartDate.atStartOfDay())
now <= salesEndDate -> ShowState.TicketingInProgress
now > salesEndDate -> ShowState.ClosedTicketing
now <= salesEndDateTime.toLocalDate() -> ShowState.TicketingInProgress
now > salesEndDateTime.toLocalDate() -> ShowState.ClosedTicketing
else -> ShowState.FinishedShow
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.launch
import timber.log.Timber
import java.time.Duration
import java.time.LocalDate
import java.time.LocalDateTime
import kotlin.math.ceil

Expand Down Expand Up @@ -171,6 +172,8 @@ fun ShowDetailScreen(
.fillMaxSize()
.padding(innerPadding),
) {
val showCountdownBanner =
uiState.showDetail.salesEndDateTime.toLocalDate() == LocalDate.now()
val host = stringResource(
id = R.string.ticketing_host_format,
uiState.showDetail.hostName,
Expand All @@ -180,16 +183,15 @@ fun ShowDetailScreen(
LazyColumn(
modifier = Modifier,
) {

item {
CountDownBanner( // todo : 날짜 변경
LocalDateTime.now().plusSeconds(15)
)
}
val paddingTop = if (showCountdownBanner) (38 + 40).dp else 16.dp

item {
Poster(
modifier = modifier.fillMaxWidth(),
modifier = modifier
.fillMaxWidth()
.clip(shape = RoundedCornerShape(bottomStart = 20.dp, bottomEnd = 20.dp))
.background(color = MaterialTheme.colorScheme.surface)
.padding(top = paddingTop),
navigateToImages = { viewModel.sendEvent(ShowDetailEvent.NavigateToImages(it)) },
title = uiState.showDetail.name,
images = uiState.showDetail.images.map { it.originImage }
Expand Down Expand Up @@ -237,6 +239,10 @@ fun ShowDetailScreen(
onGiftClicked = { onTicketClicked(TicketBottomSheetType.GIFT) }
)
}

if (showCountdownBanner) {
CountDownBanner(uiState.showDetail.salesEndDateTime)
}
}

showBottomSheet?.let { type ->
Expand Down Expand Up @@ -436,7 +442,7 @@ private fun LazyListScope.ShowInfoTab(

item {
val startDate = showDetail.salesStartDate
val endDate = showDetail.salesEndDate
val endDate = showDetail.salesEndDateTime.toLocalDate()

Section(
modifier = paddingModifier.padding(top = 8.dp),
Expand Down Expand Up @@ -669,11 +675,7 @@ private fun Poster(
modifier: Modifier = Modifier,
) {
Column(
modifier = modifier
.clip(shape = RoundedCornerShape(bottomStart = 20.dp, bottomEnd = 20.dp))
.background(color = MaterialTheme.colorScheme.surface)
.padding(top = 16.dp)
.padding(horizontal = 38.dp)
modifier = modifier.padding(horizontal = 38.dp)
) {
SwipeableImage(
modifier = Modifier
Expand Down

0 comments on commit 787b12b

Please sign in to comment.