From dd019279ec2391da4a74e06795779b3c352f1800 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 14 Dec 2022 17:56:16 +0530 Subject: [PATCH] fix(comments): ensure load failure screen renders correctly Fixes SDP-21 --- .../dev/msfjarvis/claw/common/comments/Comments.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/Comments.kt b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/Comments.kt index c35fce16..5d4aacd4 100644 --- a/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/Comments.kt +++ b/common/src/main/kotlin/dev/msfjarvis/claw/common/comments/Comments.kt @@ -6,6 +6,7 @@ */ package dev.msfjarvis.claw.common.comments +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth @@ -18,6 +19,7 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.produceState import androidx.compose.runtime.toMutableStateList +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign @@ -116,7 +118,13 @@ fun CommentsPage( } is Error -> { val error = postDetails as Error - NetworkError(label = error.description, error = error.error) + Box(modifier = Modifier.fillMaxSize()) { + NetworkError( + label = error.description, + error = error.error, + modifier = Modifier.align(Alignment.Center), + ) + } } Loading -> ProgressBar() }