Skip to content

Commit 0d0f13b

Browse files
authored
[FIX/#1624] SP3 솝레터 QA 수정사항 반영 (#1630)
* [MOD/#1624] SopletterMainTopBar 내 토픽 아이콘 표시 로직 수정 - `SopletterMainTopBar`의 `onTopicClick` 콜백을 nullable 타입으로 변경하고, null일 경우 아이콘이 보이지 않도록 수정했습니다. - `SopletterMainScreen`에서 `routeTopicId`가 존재할 경우 토픽 아이콘을 숨기도록(null 전달) 변경했습니다. * [MOD/#1624] SopletterMainTopBar 아이콘 리소스 변경 - Replace `ic_btn_arrow_left` with `icon_chevron_left` in `SopletterMainTopBar`. - Remove unused `ic_btn_arrow_left.xml` drawable resource. * [MOD/#1624] Sopletter 관련 `hasNormalTopic` 필드 추가 및 토픽 클릭 로직 수정 - `SopletterMessages` 도메인 모델 및 DTO, UI State에 `hasNormalTopic` 필드 추가 - `SopletterMapper` 및 `SopletterMainViewModel`에서 해당 필드 매핑 로직 추가 - `SopletterMainScreen`에서 `routeTopicId`가 없고 `hasNormalTopic`이 true일 때만 토픽 클릭이 가능하도록 로직 수정
1 parent c43c3fb commit 0d0f13b

8 files changed

Lines changed: 19 additions & 24 deletions

File tree

data/sopletter/src/main/java/org/sopt/official/data/sopletter/dto/response/SopletterMessagesResponseDto.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ data class SopletterMessagesResponseDto(
1515
val nextCursor: Long? = null,
1616
@SerialName("hasNext")
1717
val hasNext: Boolean,
18+
@SerialName("hasNormalTopic")
19+
val hasNormalTopic: Boolean? = null,
1820
@SerialName("messages")
1921
val messages: List<SopletterMessageDto>,
2022
)

data/sopletter/src/main/java/org/sopt/official/data/sopletter/mapper/SopletterMapper.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ internal fun SopletterMessagesResponseDto.toDomain(): SopletterMessages = Soplet
4444
totalCount = totalCount,
4545
nextCursor = nextCursor,
4646
hasNext = hasNext,
47+
hasNormalTopic = hasNormalTopic,
4748
messages = messages.map(SopletterMessageDto::toDomain),
4849
)
4950

domain/sopletter/src/main/java/org/sopt/official/domain/sopletter/model/SopletterMessages.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ data class SopletterMessages(
66
val totalCount: Int,
77
val nextCursor: Long?,
88
val hasNext: Boolean,
9+
val hasNormalTopic: Boolean?,
910
val messages: List<SopletterMessage>,
1011
)
1112

feature/sopletter/src/main/java/org/sopt/official/feature/sopletter/main/SopletterMainScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private fun SopletterMainScreen(
194194
onBackClick = onBackClick,
195195
onDownloadClick = onDownloadClick,
196196
onReportClick = onReportClick,
197-
onTopicClick = if (uiState.routeTopicId == null) onTopicClick else onBackClick,
197+
onTopicClick = if (uiState.routeTopicId == null && uiState.hasNormalTopic == true) onTopicClick else null,
198198
)
199199

200200
when {

feature/sopletter/src/main/java/org/sopt/official/feature/sopletter/main/SopletterMainViewModel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ class SopletterMainViewModel @Inject constructor(
151151
totalCount = response.totalCount,
152152
nextCursor = response.nextCursor,
153153
hasNext = response.hasNext,
154+
hasNormalTopic = response.hasNormalTopic,
154155
memoList = if (isLoadMore) {
155156
(state.memoList + response.messages)
156157
.distinctBy(SopletterMessage::messageId)

feature/sopletter/src/main/java/org/sopt/official/feature/sopletter/main/component/SopletterMainTopBar.kt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ internal fun SopletterMainTopBar(
5252
onBackClick: () -> Unit,
5353
onDownloadClick: () -> Unit,
5454
onReportClick: () -> Unit,
55-
onTopicClick: () -> Unit,
55+
onTopicClick: (() -> Unit)?,
5656
modifier: Modifier = Modifier,
5757
) {
5858
Row(
@@ -72,7 +72,7 @@ internal fun SopletterMainTopBar(
7272
) {
7373
Icon(
7474
imageVector = ImageVector.vectorResource(
75-
if (isTopicDetail) R.drawable.ic_btn_arrow_left else R.drawable.ic_close_32,
75+
if (isTopicDetail) R.drawable.icon_chevron_left else R.drawable.ic_close_32,
7676
),
7777
contentDescription = null,
7878
tint = Color.Unspecified,
@@ -115,14 +115,16 @@ internal fun SopletterMainTopBar(
115115
.noRippleClickable(onClick = onReportClick),
116116
)
117117

118-
Icon(
119-
imageVector = ImageVector.vectorResource(R.drawable.ic_topic_32),
120-
contentDescription = null,
121-
tint = Color.Unspecified,
122-
modifier = Modifier
123-
.size(32.dp)
124-
.noRippleClickable(onClick = onTopicClick),
125-
)
118+
if (onTopicClick != null) {
119+
Icon(
120+
imageVector = ImageVector.vectorResource(R.drawable.ic_topic_32),
121+
contentDescription = null,
122+
tint = Color.Unspecified,
123+
modifier = Modifier
124+
.size(32.dp)
125+
.noRippleClickable(onClick = onTopicClick),
126+
)
127+
}
126128
}
127129
}
128130
}

feature/sopletter/src/main/java/org/sopt/official/feature/sopletter/main/model/SopletterMainUiState.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ data class SopletterMainUiState(
4040
val totalCount: Int = 0,
4141
val nextCursor: Long? = null,
4242
val hasNext: Boolean = false,
43+
val hasNormalTopic: Boolean? = null,
4344
val cta: SopletterCta? = null,
4445
val memoList: ImmutableList<SopletterMessage> = persistentListOf(),
4546
val reportFormUrl: String? = null,

feature/sopletter/src/main/res/drawable/ic_btn_arrow_left.xml

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)