Skip to content

Commit 55f0773

Browse files
UI: show a hint if there is no comments
1 parent ebbab1b commit 55f0773

File tree

10 files changed

+27
-0
lines changed

10 files changed

+27
-0
lines changed

android/src/main/kotlin/project/pipepipe/app/ui/list/CommentList.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ import project.pipepipe.shared.infoitem.CommentInfo
3535
import project.pipepipe.app.ui.item.CommentItem
3636
import project.pipepipe.app.ui.screens.Screen
3737
import project.pipepipe.app.SharedContext
38+
import dev.icerock.moko.resources.compose.stringResource
39+
import project.pipepipe.app.MR
3840

3941
@OptIn(ExperimentalFoundationApi::class)
4042
@Composable
@@ -85,6 +87,22 @@ fun CommentList(
8587
CircularProgressIndicator()
8688
}
8789
}
90+
} else if (comments.isEmpty()) {
91+
// Show empty state when there are no comments and not loading
92+
item {
93+
Box(
94+
modifier = Modifier
95+
.fillMaxWidth()
96+
.padding(32.dp),
97+
contentAlignment = Alignment.Center
98+
) {
99+
Text(
100+
text = stringResource(MR.strings.no_comments_yet),
101+
style = MaterialTheme.typography.bodyLarge,
102+
color = MaterialTheme.colorScheme.onSurfaceVariant
103+
)
104+
}
105+
}
88106
} else {
89107
if (showStickyHeader) {
90108
stickyHeader {

library/src/commonMain/moko-resources/base/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@
391391
<string name="comment_creator_heart">Creator heart</string>
392392
<string name="comment_replies">%d replies</string>
393393
<string name="comment_view_pictures">View pictures (%d)</string>
394+
<string name="no_comments_yet">No comments yet</string>
394395
<string name="trending">Trending</string>
395396
<string name="recommended_lives">Recommended Lives</string>
396397
<string name="show_details">Show video details</string>

library/src/commonMain/moko-resources/de/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,5 @@
440440
<string name="playback_skip_silence_summary">Stille Passagen während der Wiedergabe automatisch überspringen</string>
441441
<string name="playback_skip_silence_title">Stille überspringen</string>
442442
<string name="playback_error">Wiedergabefehler</string>
443+
<string name="no_comments_yet">Noch keine Kommentare</string>
443444
</resources>

library/src/commonMain/moko-resources/es/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,5 @@
440440
<string name="playback_skip_silence_summary">Omitir automáticamente las partes silenciosas durante la reproducción</string>
441441
<string name="playback_skip_silence_title">Omitir silencio</string>
442442
<string name="playback_error">Error de reproducción</string>
443+
<string name="no_comments_yet">Aún no hay comentarios</string>
443444
</resources>

library/src/commonMain/moko-resources/fr/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,5 @@
440440
<string name="playback_skip_silence_summary">Ignorer automatiquement les parties silencieuses pendant la lecture</string>
441441
<string name="playback_skip_silence_title">Ignorer les silences</string>
442442
<string name="playback_error">Erreur de lecture</string>
443+
<string name="no_comments_yet">Aucun commentaire pour l\'instant</string>
443444
</resources>

library/src/commonMain/moko-resources/it/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,5 @@
440440
<string name="playback_skip_silence_summary">Salta automaticamente le parti silenziose durante la riproduzione</string>
441441
<string name="playback_skip_silence_title">Salta il silenzio</string>
442442
<string name="playback_error">Errore di riproduzione</string>
443+
<string name="no_comments_yet">Nessun commento ancora</string>
443444
</resources>

library/src/commonMain/moko-resources/ja/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,5 @@
440440
<string name="playback_skip_silence_summary">再生中に無音部分を自動的にスキップする</string>
441441
<string name="playback_skip_silence_title">無音をスキップ</string>
442442
<string name="playback_error">再生エラー</string>
443+
<string name="no_comments_yet">まだコメントはありません</string>
443444
</resources>

library/src/commonMain/moko-resources/vi/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,5 @@
440440
<string name="playback_skip_silence_summary">Tự động bỏ qua các phần im lặng trong khi phát lại</string>
441441
<string name="playback_skip_silence_title">Bỏ qua im lặng</string>
442442
<string name="playback_error">Lỗi phát lại</string>
443+
<string name="no_comments_yet">Chưa có bình luận nào</string>
443444
</resources>

library/src/commonMain/moko-resources/zh-CN/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@
371371
<string name="comment_creator_heart">创作者爱心</string>
372372
<string name="comment_replies">%d 条回复</string>
373373
<string name="comment_view_pictures">查看图片 (%d)</string>
374+
<string name="no_comments_yet">暂无评论</string>
374375
<string name="trending">热门</string>
375376
<string name="recommended_lives">推荐直播</string>
376377
<string name="show_details">显示视频详情</string>

library/src/commonMain/moko-resources/zh-TW/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,4 +440,5 @@
440440
<string name="playback_skip_silence_summary">播放時自動跳過靜音部分</string>
441441
<string name="playback_skip_silence_title">跳過靜音</string>
442442
<string name="playback_error">播放錯誤</string>
443+
<string name="no_comments_yet">尚無留言</string>
443444
</resources>

0 commit comments

Comments
 (0)