Skip to content

Commit

Permalink
Linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmitrevski committed Oct 24, 2023
1 parent 8d29b80 commit b8b0bff
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions DemoAppSwiftUI/AppleMessageComposerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,7 @@ struct AppleMessageComposerView<Factory: ViewFactory>: View, KeyboardReadable {
removeAttachmentWithId: viewModel.removeAttachment(with:)
)
.overlay(
viewModel.sendButtonEnabled ?
BottomRightView {
Button {
viewModel.sendMessage(quotedMessage: nil, editedMessage: nil) {
onMessageSent()
}
} label: {
Image(systemName: "arrow.up.circle.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 24)
.foregroundColor(.blue)
}
.padding(.trailing, 4)
.padding(.bottom, viewModel.addedAssets.count > 0 ? 16 : 8)
}
: nil
viewModel.sendButtonEnabled ? sendButton : nil
)
}
.padding(.all, 8)
Expand Down Expand Up @@ -193,6 +177,24 @@ struct AppleMessageComposerView<Factory: ViewFactory>: View, KeyboardReadable {
.allowsHitTesting(state == .expanded)
)
}

private var sendButton: some View {
BottomRightView {
Button {
viewModel.sendMessage(quotedMessage: nil, editedMessage: nil) {
onMessageSent()
}
} label: {
Image(systemName: "arrow.up.circle.fill")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 24)
.foregroundColor(.blue)
}
.padding(.trailing, 4)
.padding(.bottom, !viewModel.addedAssets.isEmpty ? 16 : 8)
}
}
}

@available(iOS 15.0, *)
Expand Down

0 comments on commit b8b0bff

Please sign in to comment.