@@ -3,8 +3,10 @@ package com.cornellappdev.transit.ui.components.home
33import androidx.compose.foundation.layout.Column
44import androidx.compose.foundation.layout.PaddingValues
55import androidx.compose.foundation.layout.Row
6+ import androidx.compose.foundation.layout.Spacer
67import androidx.compose.foundation.layout.fillMaxSize
78import androidx.compose.foundation.layout.fillMaxWidth
9+ import androidx.compose.foundation.layout.height
810import androidx.compose.foundation.layout.padding
911import androidx.compose.foundation.lazy.LazyColumn
1012import androidx.compose.foundation.lazy.LazyListScope
@@ -53,7 +55,8 @@ fun EcosystemBottomSheetContent(
5355 modifier : Modifier = Modifier ,
5456 navigateToPlace : (Place ) -> Unit ,
5557 onDetailsClick : (DetailedEcosystemPlace ) -> Unit ,
56- onFavoriteStarClick : (Place ) -> Unit
58+ onFavoriteStarClick : (Place ) -> Unit ,
59+ onAddFavoritesClick : () -> Unit ,
5760) {
5861 Column (modifier = modifier) {
5962 Row (
@@ -93,7 +96,8 @@ fun EcosystemBottomSheetContent(
9396 favorites = favorites,
9497 navigateToPlace = navigateToPlace,
9598 onDetailsClick = onDetailsClick,
96- onFavoriteStarClick = onFavoriteStarClick
99+ onFavoriteStarClick = onFavoriteStarClick,
100+ onAddFavoritesClick = onAddFavoritesClick
97101 )
98102 }
99103}
@@ -106,15 +110,16 @@ private fun BottomSheetFilteredContent(
106110 favorites : Set <Place >,
107111 navigateToPlace : (Place ) -> Unit ,
108112 onDetailsClick : (DetailedEcosystemPlace ) -> Unit ,
109- onFavoriteStarClick : (Place ) -> Unit
113+ onFavoriteStarClick : (Place ) -> Unit ,
114+ onAddFavoritesClick : () -> Unit
110115) {
111116 LazyColumn (
112- contentPadding = PaddingValues (bottom = 90 .dp),
117+ contentPadding = PaddingValues (start = 24 .dp, end = 24 .dp, top = 20 .dp, bottom = 90 .dp),
113118 modifier = Modifier .fillMaxSize()
114119 ) {
115120 when (currentFilter) {
116121 FilterState .FAVORITES -> {
117- favoriteList(favorites, navigateToPlace)
122+ favoriteList(favorites, navigateToPlace, onAddFavoritesClick )
118123 }
119124
120125 FilterState .PRINTERS -> {
@@ -160,15 +165,21 @@ private fun BottomSheetFilteredContent(
160165 */
161166private fun LazyListScope.favoriteList (
162167 favorites : Set <Place >,
163- navigateToPlace : (Place ) -> Unit
168+ navigateToPlace : (Place ) -> Unit ,
169+ onAddFavoritesClick : () -> Unit
164170) {
171+ item {
172+ AddFavoritesButton (onAddFavoritesClick = onAddFavoritesClick)
173+ Spacer (Modifier .height(20 .dp))
174+ }
165175 items(favorites.toList()) {
166176 BottomSheetLocationCard (
167177 title = it.name,
168178 subtitle1 = it.subLabel
169179 ) {
170180 // TODO: Eatery
171181 }
182+ Spacer (Modifier .height(10 .dp))
172183 }
173184}
174185
@@ -213,7 +224,9 @@ private fun LazyListScope.gymList(
213224 ) {
214225 onDetailsClick(it)
215226 }
227+ Spacer (Modifier .height(10 .dp))
216228 }
229+
217230 }
218231 }
219232}
@@ -242,7 +255,9 @@ private fun LazyListScope.printerList(
242255 it.toPlace()
243256 )
244257 }
258+ Spacer (Modifier .height(10 .dp))
245259 }
260+
246261 }
247262 }
248263}
@@ -284,6 +299,7 @@ private fun LazyListScope.eateryList(
284299 ) {
285300 onDetailsClick(it)
286301 }
302+ Spacer (Modifier .height(10 .dp))
287303 }
288304 }
289305 }
@@ -319,6 +335,7 @@ private fun LazyListScope.libraryList(
319335 ) {
320336 navigateToDetails(it)
321337 }
338+ Spacer (Modifier .height(10 .dp))
322339 }
323340 }
324341 }
@@ -347,6 +364,7 @@ private fun PreviewEcosystemBottomSheet() {
347364 modifier = Modifier ,
348365 navigateToPlace = {},
349366 onDetailsClick = {},
350- onFavoriteStarClick = {}
367+ onFavoriteStarClick = {},
368+ onAddFavoritesClick = {}
351369 )
352370}
0 commit comments