File tree Expand file tree Collapse file tree
app/src/main/java/com/cornellappdev/score/screen Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,14 +173,15 @@ private fun HomeLazyColumn(
173173 Spacer (modifier = Modifier .height(16 .dp))
174174 }
175175 }
176- }
177- }
178- if (uiState.filteredGames.isEmpty()) {
179- Box (
180- modifier = Modifier .fillMaxSize(),
181- contentAlignment = Alignment .Center
182- ) {
183- EmptyState ()
176+ } else {
177+ item {
178+ Box (
179+ modifier = Modifier .fillMaxSize(),
180+ contentAlignment = Alignment .Center
181+ ) {
182+ EmptyState ()
183+ }
184+ }
184185 }
185186 }
186187}
@@ -210,22 +211,16 @@ private fun HomeScreenPreview() = ScorePreview {
210211@Preview
211212@Composable
212213private fun HomeScreenEmptyStatePreview () = ScorePreview {
213- Column (
214- modifier = Modifier
215- .fillMaxSize()
216- .background(color = Color .White )
217- ) {
218- HomeContent (
219- HomeUiState (
220- selectedGender = GenderDivision .ALL ,
221- sportSelect = SportSelection .All ,
222- selectionList = sportSelectionList,
223- loadedState = ApiResponse .Success (emptyList())
224- ),
225- onGenderSelected = {},
226- onSportSelected = {},
227- onRefresh = {}
228- )
229- }
214+ HomeContent (
215+ HomeUiState (
216+ selectedGender = GenderDivision .ALL ,
217+ sportSelect = SportSelection .All ,
218+ selectionList = sportSelectionList,
219+ loadedState = ApiResponse .Success (emptyList())
220+ ),
221+ onGenderSelected = {},
222+ onSportSelected = {},
223+ onRefresh = {}
224+ )
230225}
231226
Original file line number Diff line number Diff line change @@ -164,14 +164,15 @@ private fun PastGamesLazyColumn(
164164 Spacer (modifier = Modifier .height(16 .dp))
165165 }
166166 }
167- }
168- }
169- if (uiState.filteredGames.isEmpty()) {
170- Box (
171- modifier = Modifier .fillMaxSize(),
172- contentAlignment = Alignment .Center
173- ) {
174- EmptyState ()
167+ } else {
168+ item{
169+ Box (
170+ modifier = Modifier .fillMaxSize(),
171+ contentAlignment = Alignment .Center
172+ ) {
173+ EmptyState ()
174+ }
175+ }
175176 }
176177 }
177178}
You can’t perform that action at this time.
0 commit comments