mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 17:42:45 +02:00
Configured and applied SwiftFormat
This commit is contained in:
committed by
Stefan Ceriu
parent
ff2e6ddfa7
commit
43c28d23b7
+5
-7
@@ -14,11 +14,10 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomChat: View {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
@@ -32,7 +31,7 @@ struct TemplateRoomChat: View {
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
VStack{
|
||||
VStack {
|
||||
roomContent
|
||||
}.frame(maxHeight: .infinity)
|
||||
|
||||
@@ -51,7 +50,6 @@ struct TemplateRoomChat: View {
|
||||
.animation(.easeOut(duration: 0.25))
|
||||
.transition(.move(edge: .trailing))
|
||||
.padding()
|
||||
|
||||
}
|
||||
.background(theme.colors.background)
|
||||
.navigationTitle(viewModel.viewState.roomName ?? "Chat")
|
||||
@@ -83,14 +81,14 @@ struct TemplateRoomChat: View {
|
||||
|
||||
private var bubbleList: some View {
|
||||
ScrollViewReader { reader in
|
||||
ScrollView{
|
||||
ScrollView {
|
||||
LazyVStack {
|
||||
ForEach(viewModel.viewState.bubbles) { bubble in
|
||||
TemplateRoomChatBubbleView(bubble: bubble)
|
||||
.id(bubble.id)
|
||||
}
|
||||
}
|
||||
.onAppear{
|
||||
.onAppear {
|
||||
guard let lastBubbleId = viewModel.viewState.bubbles.last?.id
|
||||
else { return }
|
||||
reader.scrollTo(lastBubbleId, anchor: .bottom)
|
||||
@@ -116,7 +114,7 @@ struct TemplateRoomChat: View {
|
||||
}
|
||||
|
||||
private var itemCount: Int {
|
||||
return viewModel.viewState
|
||||
viewModel.viewState
|
||||
.bubbles
|
||||
.map(\.items)
|
||||
.map(\.count)
|
||||
|
||||
-1
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomChatBubbleContentView: View {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
-1
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomChatBubbleImage: View {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
-1
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomChatBubbleMessage: View {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
|
||||
+3
-4
@@ -17,7 +17,6 @@
|
||||
import SwiftUI
|
||||
|
||||
struct TemplateRoomChatBubbleView: View {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// MARK: Private
|
||||
@@ -29,10 +28,10 @@ struct TemplateRoomChatBubbleView: View {
|
||||
let bubble: TemplateRoomChatBubble
|
||||
|
||||
var body: some View {
|
||||
HStack(alignment: .top){
|
||||
HStack(alignment: .top) {
|
||||
AvatarImage(avatarData: bubble.sender.avatarData, size: .xSmall)
|
||||
.accessibility(identifier: "bubbleImage")
|
||||
VStack(alignment: .leading){
|
||||
VStack(alignment: .leading) {
|
||||
Text(bubble.sender.displayName ?? "")
|
||||
.foregroundColor(theme.userColor(for: bubble.sender.id))
|
||||
.font(theme.fonts.bodySB)
|
||||
@@ -42,7 +41,7 @@ struct TemplateRoomChatBubbleView: View {
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
//add to a style
|
||||
// add to a style
|
||||
.padding(.horizontal)
|
||||
.padding(.vertical, 8)
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
Reference in New Issue
Block a user