Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
⚡️ :: 댓글 없는 경우 텍스트 표시
Browse files Browse the repository at this point in the history
  • Loading branch information
Tmdhoon2 committed Nov 30, 2023
1 parent 1822964 commit 9f51ae5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.signal.signal_android.feature.main.feed

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand Down Expand Up @@ -34,6 +35,7 @@ import com.signal.signal_android.designsystem.foundation.Body
import com.signal.signal_android.designsystem.foundation.Body2
import com.signal.signal_android.designsystem.foundation.BodyLarge2
import com.signal.signal_android.designsystem.foundation.SignalColor
import com.signal.signal_android.designsystem.foundation.SubTitle
import com.signal.signal_android.designsystem.textfield.SignalTextField
import java.time.LocalDateTime

Expand Down Expand Up @@ -81,10 +83,27 @@ internal fun CommentDialog(
.fillMaxWidth()
.padding(vertical = 10.dp),
)
Comments(
commentEntities = state.comments,
feedViewModel = feedViewModel,
)
if (state.comments.isNotEmpty()) {
Comments(
commentEntities = state.comments,
feedViewModel = feedViewModel,
)
} else {
Column(
modifier = Modifier
.fillMaxWidth()
.fillMaxHeight(0.8f),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
) {
SubTitle(text = stringResource(id = R.string.comment_dialog_empty))
Spacer(modifier = Modifier.height(4.dp))
Body(
text = stringResource(id = R.string.comment_dialog_create),
color = SignalColor.Primary100,
)
}
}
}
Box(
modifier = Modifier
Expand Down
2 changes: 2 additions & 0 deletions presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@
<!--comment dialog-->
<string name="comment_dialog_comment">댓글</string>
<string name="comment_dialog_input_comment">댓글을 입력하세요</string>
<string name="comment_dialog_empty">아직 댓글이 없어요!</string>
<string name="comment_dialog_create">반응을 남겨보세요!</string>

<!--header-->
<string name="header_back">뒤로가기</string>
Expand Down

0 comments on commit 9f51ae5

Please sign in to comment.