@@ -17,6 +17,7 @@ import com.songlib.data.models.ListingUi
1717@Composable
1818fun ChoosingListingSheet (
1919 listings : List <ListingUi >,
20+ isProUser : Boolean ,
2021 onDismiss : () -> Unit ,
2122 onNewListClick : () -> Unit ,
2223 onListingClick : (ListingUi ) -> Unit ,
@@ -39,16 +40,51 @@ fun ChoosingListingSheet(
3940 .padding(bottom = 12 .dp)
4041 )
4142
43+ // Upgrade banner for free users with existing listings
44+ if (! isProUser && listings.isNotEmpty()) {
45+ Card (
46+ modifier = Modifier
47+ .fillMaxWidth()
48+ .padding(bottom = 16 .dp),
49+ colors = CardDefaults .cardColors(
50+ containerColor = MaterialTheme .colorScheme.primaryContainer
51+ ),
52+ elevation = CardDefaults .cardElevation(defaultElevation = 2 .dp)
53+ ) {
54+ Row (
55+ modifier = Modifier
56+ .fillMaxWidth()
57+ .padding(horizontal = 12 .dp, vertical = 8 .dp),
58+ verticalAlignment = Alignment .CenterVertically
59+ ) {
60+ Icon (
61+ imageVector = Icons .Filled .Star ,
62+ contentDescription = " Pro feature" ,
63+ tint = MaterialTheme .colorScheme.primary,
64+ modifier = Modifier .size(20 .dp)
65+ )
66+
67+ Spacer (modifier = Modifier .width(8 .dp))
68+
69+ Text (
70+ text = " Free users can only have 1 listing" ,
71+ style = MaterialTheme .typography.bodySmall,
72+ modifier = Modifier .weight(1f )
73+ )
74+ }
75+ }
76+ }
77+
4278 LazyColumn (
4379 modifier = Modifier
4480 .weight(1f , fill = false )
4581 .padding(bottom = 16 .dp)
4682 ) {
47- item() {
83+ item {
4884 Row (
4985 modifier = Modifier
5086 .fillMaxWidth()
51- .clickable { onNewListClick }
87+ .clickable { onNewListClick() }
5288 .padding(vertical = 12 .dp),
5389 verticalAlignment = Alignment .CenterVertically
5490 ) {
@@ -76,7 +112,7 @@ fun ChoosingListingSheet(
76112 Row (
77113 modifier = Modifier
78114 .fillMaxWidth()
79- .clickable { onListingClick }
115+ .clickable { onListingClick(listing) }
80116 .padding(vertical = 12 .dp),
81117 verticalAlignment = Alignment .CenterVertically
82118 ) {
@@ -109,4 +145,3 @@ fun ChoosingListingSheet(
109145 }
110146 }
111147}
112-
0 commit comments