Meshtastic-Apple/Meshtastic/Views/Messages/TextMessageField/TextMessageSize.swift
Austin Payne 3882add56a fix: slow typing speed when lots of messages
Refactors both the channel and user message views to isolate typing state which
prevents excessive re-rendering of large message lists on every new character
typed. Also consolidates typing view code of both lists into the new
TextMessageField and related sub views.
2024-02-11 21:47:09 -07:00

20 lines
466 B
Swift

import SwiftUI
struct TextMessageSize: View {
let maxbytes: Int
let totalBytes: Int
var body: some View {
ProgressView("\("bytes".localized): \(totalBytes) / \(maxbytes)", value: Double(totalBytes), total: Double(maxbytes))
.frame(width: 130)
.padding(5)
.font(.subheadline)
.accentColor(.accentColor)
}
}
struct TextMessageSizePreview: PreviewProvider {
static var previews: some View {
TextMessageSize(maxbytes: 228, totalBytes: 100)
}
}