|
|
@@ -130,31 +130,36 @@ struct WordsCountView: View {
|
|
|
|
|
|
private var statsRow: some View {
|
|
|
HStack(spacing: 12) {
|
|
|
- StatBadge(title: "Words", value: "\(viewModel.wordCount)")
|
|
|
- StatBadge(title: "Sentences", value: "\(viewModel.sentenceCount)")
|
|
|
- StatBadge(title: "Paragraphs", value: "\(viewModel.paragraphCount)")
|
|
|
- StatBadge(title: "Characters", value: "\(viewModel.characterCount)")
|
|
|
+ StatItem(title: "Words", value: "\(viewModel.wordCount)")
|
|
|
+ StatItem(title: "Sentences", value: "\(viewModel.sentenceCount)")
|
|
|
+ StatItem(title: "Paragraphs", value: "\(viewModel.paragraphCount)")
|
|
|
+ StatItem(title: "Characters", value: "\(viewModel.characterCount)")
|
|
|
+ Spacer(minLength: 0)
|
|
|
}
|
|
|
+ .padding(.vertical, 6)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-private struct StatBadge: View {
|
|
|
+private struct StatItem: View {
|
|
|
let title: String
|
|
|
let value: String
|
|
|
|
|
|
var body: some View {
|
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
|
Text(value)
|
|
|
- .font(.system(size: 16, weight: .semibold))
|
|
|
+ .font(.system(size: 20, weight: .semibold))
|
|
|
.foregroundStyle(AppTheme.teal)
|
|
|
|
|
|
Text(title)
|
|
|
- .font(.system(size: 11))
|
|
|
+ .font(.system(size: 12))
|
|
|
.foregroundStyle(AppTheme.textMuted)
|
|
|
}
|
|
|
+ .frame(minWidth: 96, alignment: .leading)
|
|
|
.padding(.horizontal, 14)
|
|
|
.padding(.vertical, 10)
|
|
|
.background(AppTheme.tealLight)
|
|
|
.clipShape(RoundedRectangle(cornerRadius: 10))
|
|
|
+ .accessibilityElement(children: .combine)
|
|
|
+ .accessibilityLabel("\(value) \(title)")
|
|
|
}
|
|
|
}
|