-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathReposErrorScreen.kt
60 lines (55 loc) · 1.72 KB
/
ReposErrorScreen.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package nextstep.github.ui.repos
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import nextstep.github.R
@Composable
internal fun ReposErrorScreen(
onRetryClick: () -> Unit,
) {
Box(
modifier = Modifier
.fillMaxSize()
.background(color = MaterialTheme.colorScheme.background),
contentAlignment = Alignment.Center
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = stringResource(R.string.repos_errorscreen_guide_message),
style = MaterialTheme.typography.bodyMedium
)
Spacer(modifier = Modifier.height(8.dp))
Button(
onClick = onRetryClick
) {
Text(
text = stringResource(R.string.repos_errorscreen_retry_button),
style = MaterialTheme.typography.bodyMedium
)
}
}
}
}
@Preview
@Composable
private fun ReposErrorScreenPreview() {
MaterialTheme {
ReposErrorScreen(
onRetryClick = {},
)
}
}