Skip to content

Commit 0c04566

Browse files
authored
Merge pull request #4322 from anyproto/ios-5505-max-count-999-for-a-badge
IOS-5505 Add max count 999+ for badge counter
2 parents f699761 + 3611b89 commit 0c04566

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Anytype/Sources/PresentationLayer/Common/SwiftUI/CounterView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ enum CounterViewStyle {
77
}
88

99
struct CounterView: View {
10-
11-
let count: Int
10+
11+
let text: String
1212
let style: CounterViewStyle
13-
13+
1414
init(count: Int, style: CounterViewStyle = .default) {
15-
self.count = count
15+
self.text = count > 999 ? "999+" : "\(count)"
1616
self.style = style
1717
}
18-
18+
1919
var body: some View {
20-
Text("\(count)")
20+
Text(text)
2121
.anytypeFontStyle(.caption1Regular) // Without line height multiple
2222
.foregroundStyle(Color.Control.white)
2323
.frame(height: 20)

0 commit comments

Comments
 (0)