mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Fix call timeline item snapshots. (#5923)
* Fix call timeline item snapshots. * Fix a warning and hard code the call timer during tests.
This commit is contained in:
+16
-7
@@ -98,7 +98,7 @@ struct ActiveCallTimelineItemView: View {
|
||||
|
||||
VStack(spacing: 4) {
|
||||
if !isJoined {
|
||||
Button(action: { context?.send(viewAction: .joinActiveCall(isVoiceCall: isVoiceCall)) }) {
|
||||
Button { context?.send(viewAction: .joinActiveCall(isVoiceCall: isVoiceCall)) } label: {
|
||||
Text(L10n.actionJoin)
|
||||
.font(.compound.bodyMDSemibold)
|
||||
.padding(.horizontal, 6)
|
||||
@@ -107,12 +107,10 @@ struct ActiveCallTimelineItemView: View {
|
||||
.buttonStyle(.compound(.primary, size: .small))
|
||||
}
|
||||
|
||||
if let callStartTimestamp {
|
||||
Text(callStartTimestamp, style: .timer)
|
||||
.font(.compound.bodyXS)
|
||||
.foregroundColor(.compound.textSecondary)
|
||||
.monospacedDigit()
|
||||
}
|
||||
callTimer
|
||||
.font(.compound.bodyXS)
|
||||
.foregroundColor(.compound.textSecondary)
|
||||
.monospacedDigit()
|
||||
}
|
||||
}
|
||||
.padding(12)
|
||||
@@ -120,6 +118,17 @@ struct ActiveCallTimelineItemView: View {
|
||||
.stroke(.compound.borderInteractivePrimary, lineWidth: 1))
|
||||
.padding(16)
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private var callTimer: some View {
|
||||
if let callStartTimestamp {
|
||||
if ProcessInfo.isRunningTests {
|
||||
Text("0:00") // A slow runner can take more than a second to record the snapshot 🤦♂️
|
||||
} else {
|
||||
Text(callStartTimestamp, style: .timer)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
Reference in New Issue
Block a user