Fix feature card truncation and unequal sizing on subscription screens
Replace HStack layout with LazyVGrid for uniform card sizing, remove lineLimit(1) to allow multiline subtitles, and add 1:1 aspect ratio so all four feature cards are identical squares across all 12 themes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1976,40 +1976,41 @@ struct JournalPagesView: View {
|
|||||||
struct FeatureCardsGrid: View {
|
struct FeatureCardsGrid: View {
|
||||||
let style: PaywallStyle
|
let style: PaywallStyle
|
||||||
|
|
||||||
|
private let columns = [
|
||||||
|
GridItem(.flexible(), spacing: 12),
|
||||||
|
GridItem(.flexible(), spacing: 12)
|
||||||
|
]
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack(spacing: 12) {
|
LazyVGrid(columns: columns, spacing: 12) {
|
||||||
HStack(spacing: 12) {
|
FeatureCard(
|
||||||
FeatureCard(
|
icon: "chart.line.uptrend.xyaxis",
|
||||||
icon: "chart.line.uptrend.xyaxis",
|
title: "See Patterns",
|
||||||
title: "See Patterns",
|
subtitle: "Month & year views",
|
||||||
subtitle: "Month & year views",
|
style: style,
|
||||||
style: style,
|
accentIndex: 0
|
||||||
accentIndex: 0
|
)
|
||||||
)
|
FeatureCard(
|
||||||
FeatureCard(
|
icon: "sparkles",
|
||||||
icon: "sparkles",
|
title: "AI Insights",
|
||||||
title: "AI Insights",
|
subtitle: "Understand your moods",
|
||||||
subtitle: "Understand your moods",
|
style: style,
|
||||||
style: style,
|
accentIndex: 1
|
||||||
accentIndex: 1
|
)
|
||||||
)
|
FeatureCard(
|
||||||
}
|
icon: "heart.circle",
|
||||||
HStack(spacing: 12) {
|
title: "Health Sync",
|
||||||
FeatureCard(
|
subtitle: "Connect your data",
|
||||||
icon: "heart.circle",
|
style: style,
|
||||||
title: "Health Sync",
|
accentIndex: 2
|
||||||
subtitle: "Connect your data",
|
)
|
||||||
style: style,
|
FeatureCard(
|
||||||
accentIndex: 2
|
icon: "rectangle.grid.2x2",
|
||||||
)
|
title: "Widgets",
|
||||||
FeatureCard(
|
subtitle: "Always visible",
|
||||||
icon: "rectangle.grid.2x2",
|
style: style,
|
||||||
title: "Widgets",
|
accentIndex: 3
|
||||||
subtitle: "Always visible",
|
)
|
||||||
style: style,
|
|
||||||
accentIndex: 3
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2041,11 +2042,13 @@ struct FeatureCard: View {
|
|||||||
Text(subtitle)
|
Text(subtitle)
|
||||||
.font(.system(size: 11, weight: .medium))
|
.font(.system(size: 11, weight: .medium))
|
||||||
.foregroundColor(subtitleColor)
|
.foregroundColor(subtitleColor)
|
||||||
.lineLimit(1)
|
.fixedSize(horizontal: false, vertical: true)
|
||||||
}
|
}
|
||||||
|
Spacer(minLength: 0)
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
.padding(14)
|
.padding(14)
|
||||||
|
.aspectRatio(1, contentMode: .fill)
|
||||||
.background(cardBackground)
|
.background(cardBackground)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user