Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ fun ActionPopupContent(
) {
val pressedColor = BuyOrNotTheme.colors.gray200
Column(
modifier = Modifier.padding(6.dp),
modifier =
Modifier.padding(
horizontal = 6.dp,
vertical = 10.dp,
),
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
items.forEach { (label, onClick) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
Expand Down Expand Up @@ -64,7 +63,11 @@ fun ActionSheet(
LazyColumn(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(18.dp),
contentPadding = PaddingValues(vertical = 16.dp),
contentPadding =
PaddingValues(
top = 26.dp,
bottom = 30.dp,
),
) {
items(
count = actions.size,
Expand Down Expand Up @@ -92,9 +95,11 @@ private fun ActionItemRow(
modifier =
Modifier
.fillMaxWidth()
.height(30.dp)
.clickable(onClick = onClick)
.padding(horizontal = 24.dp),
.padding(
horizontal = 24.dp,
vertical = 6.dp,
),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Start,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ fun FeedCard(
productLink: String? = null,
onLinkClick: (url: String) -> Unit = {},
showProductLinkTooltip: Boolean = false,
onTooltipDismiss: () -> Unit = {},
onImageClick: (imageUrls: List<String>, page: Int) -> Unit = { _, _ -> },
) {
val hasVoted = userVotedOptionIndex != null
Expand Down Expand Up @@ -140,7 +141,10 @@ fun FeedCard(
price = price,
productLink = productLink,
showTooltip = tooltipVisible,
onTooltipDismiss = { tooltipVisible = false },
onTooltipDismiss = {
tooltipVisible = false
onTooltipDismiss()
},
onFullscreenClick = { page -> onImageClick(productImageUrls, page) },
onLinkClick = onLinkClick,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ data class HomeUiState(
val blockingNickname: String? = null,
val blockingUserId: Long? = null,
val showSortSheet: Boolean = false,
val isTooltipDismissed: Boolean = false,
)

/**
Expand Down Expand Up @@ -141,6 +142,8 @@ sealed interface HomeIntent {
data object ShowSortSheet : HomeIntent

data object DismissSortSheet : HomeIntent

data object DismissTooltip : HomeIntent
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ private fun HomeFeedList(
derivedStateOf { listState.firstVisibleItemIndex == 0 && listState.firstVisibleItemScrollOffset == 0 }
}

var showLinkTooltip by remember { mutableStateOf(true) }
val tooltipTargetIndex =
remember(filteredFeeds) {
filteredFeeds.indexOfFirst { it.productLink != null }
Expand Down Expand Up @@ -454,12 +453,13 @@ private fun HomeFeedList(
voterProfileImageUrl = uiState.voterProfileImageUrl,
isGuest = uiState.userType == UserType.GUEST,
modifier = Modifier.animateItem(),
showProductLinkTooltip = showLinkTooltip && index == tooltipTargetIndex,
showProductLinkTooltip = !uiState.isTooltipDismissed && index == tooltipTargetIndex,
onVote = { id, opt -> onIntent(HomeIntent.OnVoteClicked(id, opt)) },
onDelete = { id -> onIntent(HomeIntent.ShowDeleteDialog(id)) },
onReport = { id -> onIntent(HomeIntent.OnReportClicked(id)) },
onBlock = { id -> onIntent(HomeIntent.ShowBlockDialog(id)) },
onLinkClick = onLinkClick,
onTooltipDismissed = { onIntent(HomeIntent.DismissTooltip) },
onImageClick = onImageClick,
)
}
Expand Down Expand Up @@ -507,14 +507,14 @@ private fun HomeFeedList(
item {
if (uiState.selectedTab == HomeTab.MY_FEED) {
HomeFeedEmptyView(
modifier = Modifier.padding(top = 140.dp),
modifier = Modifier.padding(top = 120.dp),
title = "아직 올린 투표가 없어요",
description = "고민되는 상품의 투표를 올려보세요!",
onUploadClick = onUploadClick,
)
} else {
HomeFeedEmptyView(
modifier = Modifier.padding(top = 120.dp),
modifier = Modifier.padding(top = 100.dp),
title = "첫번째 투표를 올려보세요!",
onUploadClick = onUploadClick,
)
Expand Down Expand Up @@ -569,7 +569,6 @@ private fun HomeFeedList(
selectedCategories = uiState.selectedCategories,
onAllCategorySelected = { onIntent(HomeIntent.OnAllCategorySelected) },
onCategoryToggled = { onIntent(HomeIntent.OnCategoryToggled(it)) },
selectedFilter = uiState.selectedFilter,
onShowSortSheet = { onIntent(HomeIntent.ShowSortSheet) },
)
Spacer(modifier = Modifier.height(10.dp))
Expand Down Expand Up @@ -604,7 +603,6 @@ private fun FilterChipRow(
selectedCategories: Set<FeedCategory>,
onAllCategorySelected: () -> Unit,
onCategoryToggled: (FeedCategory) -> Unit,
selectedFilter: FilterChip,
onShowSortSheet: () -> Unit,
) {
val listState = rememberLazyListState()
Expand Down Expand Up @@ -676,8 +674,12 @@ private fun FilterChipRow(
)
}
},
contentPadding = PaddingValues(horizontal = 8.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
contentPadding =
PaddingValues(
start = 6.dp,
end = 20.dp,
),
horizontalArrangement = Arrangement.spacedBy(6.dp),
verticalAlignment = Alignment.CenterVertically,
) {
item {
Expand Down Expand Up @@ -724,6 +726,7 @@ private fun FeedItemCard(
onReport: (String) -> Unit,
onBlock: (String) -> Unit,
onLinkClick: (url: String) -> Unit,
onTooltipDismissed: () -> Unit = {},
onImageClick: (imageUrls: List<String>, page: Int) -> Unit = { _, _ -> },
) {
Column {
Expand Down Expand Up @@ -755,6 +758,7 @@ private fun FeedItemCard(
productLink = feed.productLink,
onLinkClick = onLinkClick,
showProductLinkTooltip = showProductLinkTooltip,
onTooltipDismiss = onTooltipDismissed,
onImageClick = onImageClick,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class HomeViewModel @Inject constructor(
}
is HomeIntent.ShowSortSheet -> updateState { it.copy(showSortSheet = true) }
is HomeIntent.DismissSortSheet -> updateState { it.copy(showSortSheet = false) }
is HomeIntent.DismissTooltip -> updateState { it.copy(isTooltipDismissed = true) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ private fun NotificationFilterRow(
LazyRow(
modifier = Modifier.fillMaxWidth(),
contentPadding = PaddingValues(horizontal = 20.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(6.dp),
) {
items(filters) { filter ->
val filterText =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.PickVisualMediaRequest
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand Down Expand Up @@ -706,7 +707,12 @@ private fun SelectedImagePreview(
modifier =
Modifier
.size(68.dp)
.clip(RoundedCornerShape(12.dp)),
.clip(RoundedCornerShape(12.dp))
.border(
width = 1.dp,
color = BuyOrNotTheme.colors.gray300,
shape = RoundedCornerShape(12.dp),
),
contentAlignment = Alignment.TopEnd,
) {
AsyncImage(
Expand Down
Loading