mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +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
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:40d8037238e2d92a52ae9f6198bb625e9db2a725c6495da5174a0f3052801585
|
||||
size 164464
|
||||
oid sha256:3f63fc1b09ec77b4abd3d828fbaccf1653310724d9778c1d9d84469b4237893f
|
||||
size 164948
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:24a12ff5ba8829e72439b4e4605d6a5879ff2221c89eefbcc86513363e119bbc
|
||||
size 132982
|
||||
oid sha256:7a672b63344f405ef6bada278f8fec875a47ffd844fdd8dd86e5855da83d09a4
|
||||
size 133102
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:530f910db100c695e7e1ddb56ead0a1303c9ec732aac7f9aaec731bfade33ae6
|
||||
size 123981
|
||||
oid sha256:ea12680d6e660d45ba869dc8befdfbfae7dae8b4ea1d93a0bcd04260f4fe58ef
|
||||
size 122557
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4cb5fc7e3ef62505c3ad1f490d2f0be0c4119d128568f44cf9ce97ae55a323a1
|
||||
size 141458
|
||||
oid sha256:f3a2808f44ba49c947f8f7e992586cb9db28b85bf14f33b3cc53d1d78aea1b5a
|
||||
size 142299
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dc60dcd6739ad9ad98d6d98d76c1ac9f097c9ded0b39c5016bc8175cdb6d2100
|
||||
size 77972
|
||||
oid sha256:0d3c33a7a13828c6e538f155f4152e82be68e3a1f7f82b660c7366f22cc64a84
|
||||
size 76322
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:24a80a6ca6a3e880c4bdf6cfe7937296feac87e4aeff6f0377c4813b89876650
|
||||
size 101480
|
||||
oid sha256:84c8d0ac8e6a34e642f0c7b53dd872a58df20201944726da7582fbabf346a79a
|
||||
size 100642
|
||||
|
||||
Reference in New Issue
Block a user