Skip to content

Commit

Permalink
PR remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmitrevski committed Dec 19, 2023
1 parent 8fd872a commit de8a7cc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
private var channelConfig: ChannelConfig?
@Binding var quotedMessage: ChatMessage?
@Binding var editedMessage: ChatMessage?

private let recordingViewHeight: CGFloat = 80

public init(
viewFactory: Factory,
Expand Down Expand Up @@ -119,7 +121,7 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
)
} else if viewModel.recordingState == .locked || viewModel.recordingState == .stopped {
factory.makeComposerRecordingLockedView(viewModel: viewModel)
.frame(height: 80)
.frame(height: recordingViewHeight)
} else if viewModel.recordingState == .showingTip {
factory.makeComposerRecordingTipView()
.offset(y: -composerHeight + 12)
Expand All @@ -128,7 +130,7 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
}
}
)
.frame(height: viewModel.recordingState.showsComposer ? nil : 80)
.frame(height: viewModel.recordingState.showsComposer ? nil : recordingViewHeight)

if viewModel.sendInChannelShown {
factory.makeSendInChannelView(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ struct LockedView: View {
.offset(y: -20)
.background(Color(colors.background).edgesIgnoringSafeArea(.bottom))
.overlay(
viewModel.recordingState == .locked ? TopRightView {
LockedRecordIndicator()
}
: nil
viewModel.recordingState == .locked ? TopRightView { LockedRecordIndicator() } : nil
)
.onAppear {
player.subscribe(voiceRecordingHandler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,8 @@ struct VoiceRecordingView: View {
.foregroundColor(.primary)
.modifier(ShadowViewModifier(firstRadius: 2, firstY: 4))
})
.opacity(loading ? 0 : 1)
.overlay(
loading ? ProgressView() : nil
)
.opacity(loading ? 0 : 1)
.overlay(loading ? ProgressView() : nil)

VStack(alignment: .leading, spacing: 4) {
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class MessageComposerView_Tests: StreamChatTestCase {
onTap: {}
)
.environmentObject(MessageComposerTestUtils.makeComposerViewModel(chatClient: chatClient))
.frame(width: 40, height: 40)
.frame(width: 100, height: 40)

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))

Check failure on line 175 in StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift

View workflow job for this annotation

GitHub Actions / Test SwiftUI (Debug)

test_trailingComposerView_snapshot, failed - Snapshot does not match reference.

Check failure on line 175 in StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift

View workflow job for this annotation

GitHub Actions / Test SwiftUI (Debug)

test_trailingComposerView_snapshot, failed - Snapshot does not match reference.
Expand All @@ -186,7 +186,7 @@ class MessageComposerView_Tests: StreamChatTestCase {
onTap: {}
)
.environmentObject(MessageComposerTestUtils.makeComposerViewModel(chatClient: chatClient))
.frame(width: 40, height: 40)
.frame(width: 100, height: 40)

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))

Check failure on line 192 in StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift

View workflow job for this annotation

GitHub Actions / Test SwiftUI (Debug)

test_trailingComposerView_slowMode, failed - Snapshot does not match reference.

Check failure on line 192 in StreamChatSwiftUITests/Tests/ChatChannel/MessageComposerView_Tests.swift

View workflow job for this annotation

GitHub Actions / Test SwiftUI (Debug)

test_trailingComposerView_slowMode, failed - Snapshot does not match reference.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit de8a7cc

Please sign in to comment.