mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-06 12:08:44 +00:00
ios, android: show the order spinner only while a purchase is issued, and shorten the tier cards
This commit is contained in:
@@ -60,7 +60,7 @@ struct BadgesCheckOrderView: View {
|
||||
}
|
||||
}
|
||||
.overlay {
|
||||
if purchasing {
|
||||
if store.purchaseState(chatModel.currentUser?.userId) == .issuing {
|
||||
ZStack {
|
||||
Circle()
|
||||
.fill(.white)
|
||||
|
||||
@@ -78,7 +78,7 @@ struct BadgesChooseBadgeView: View {
|
||||
BadgeUserPreview(level: selectedLevel)
|
||||
.padding(.top, 4)
|
||||
|
||||
Spacer(minLength: 20)
|
||||
Spacer(minLength: 12)
|
||||
|
||||
// fixedSize + maxHeight on the cards so both match the taller one when a
|
||||
// store price wraps in one of them
|
||||
@@ -88,7 +88,7 @@ struct BadgesChooseBadgeView: View {
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
|
||||
Spacer(minLength: 20)
|
||||
Spacer(minLength: 12)
|
||||
|
||||
VStack(spacing: 10) {
|
||||
continueButton()
|
||||
@@ -125,8 +125,8 @@ struct BadgesChooseBadgeView: View {
|
||||
Image(badgeImageName(level.badgeType))
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(width: 60, height: 60)
|
||||
.padding(.top, 20)
|
||||
.frame(width: 44, height: 44)
|
||||
.padding(.top, 16)
|
||||
Text(level.title)
|
||||
.font(.title3)
|
||||
.fontWeight(.bold)
|
||||
@@ -138,7 +138,7 @@ struct BadgesChooseBadgeView: View {
|
||||
}
|
||||
.font(.subheadline)
|
||||
.foregroundColor(theme.colors.secondary)
|
||||
.padding(.bottom, 20)
|
||||
.padding(.bottom, 16)
|
||||
}
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.horizontal, 12)
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ fun BadgesCheckOrderView(level: BadgeLevel, period: BadgePeriod, modalManager: M
|
||||
}
|
||||
}
|
||||
|
||||
if (purchasing.value) {
|
||||
if (BadgeStore.purchaseState(chatModel.currentUser.value?.userId) == BadgePurchaseState.Issuing) {
|
||||
Box(
|
||||
Modifier.fillMaxSize(),
|
||||
contentAlignment = Alignment.Center
|
||||
|
||||
+4
-4
@@ -91,7 +91,7 @@ fun BadgesChooseBadgeView(modalManager: ModalManager) {
|
||||
|
||||
BadgeUserPreview(level = selectedLevel, modifier = Modifier.padding(top = 4.dp))
|
||||
|
||||
Spacer(Modifier.weight(1f).heightIn(min = 20.dp))
|
||||
Spacer(Modifier.weight(1f).heightIn(min = 12.dp))
|
||||
|
||||
// IntrinsicSize.Max + fillMaxHeight on children so both cards match the taller card's height
|
||||
// when 2-line labels at large fonts would otherwise size them differently.
|
||||
@@ -103,7 +103,7 @@ fun BadgesChooseBadgeView(modalManager: ModalManager) {
|
||||
LevelCard(BadgeLevel.Legend, selectedLevel, Modifier.weight(1f).fillMaxHeight()) { selectedLevel = it }
|
||||
}
|
||||
|
||||
Spacer(Modifier.weight(1f).heightIn(min = 20.dp))
|
||||
Spacer(Modifier.weight(1f).heightIn(min = 12.dp))
|
||||
|
||||
// Nested Column with no spacing so the TextButtonBelowOnboardingButton sits directly under
|
||||
// the action button (matches onboarding pattern where its own 7.5dp top padding is the gap).
|
||||
@@ -133,7 +133,7 @@ private fun LevelCard(level: BadgeLevel, selectedLevel: BadgeLevel, modifier: Mo
|
||||
.background(cardBackground, shape)
|
||||
.border(2.dp, borderColor, shape)
|
||||
.clickable { onSelect(level) }
|
||||
.padding(vertical = 20.dp, horizontal = 12.dp),
|
||||
.padding(vertical = 16.dp, horizontal = 12.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.spacedBy(10.dp)
|
||||
) {
|
||||
@@ -141,7 +141,7 @@ private fun LevelCard(level: BadgeLevel, selectedLevel: BadgeLevel, modifier: Mo
|
||||
painterResource(badgeImage(level.badgeType)),
|
||||
contentDescription = null,
|
||||
contentScale = ContentScale.Fit,
|
||||
modifier = Modifier.size(60.dp)
|
||||
modifier = Modifier.size(44.dp)
|
||||
)
|
||||
Text(stringResource(level.title), style = MaterialTheme.typography.h3, fontWeight = FontWeight.Bold, textAlign = TextAlign.Center)
|
||||
Text(BadgePeriod.Monthly.priceText(BadgeStore.price(level, BadgePeriod.Monthly)), style = MaterialTheme.typography.body1, textAlign = TextAlign.Center)
|
||||
|
||||
Reference in New Issue
Block a user