Skip to content

Commit b9409e5

Browse files
committed
Tweak the session verification icons and copy.
1 parent 814eff2 commit b9409e5

File tree

50 files changed

+120
-124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+120
-124
lines changed

ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/SessionVerificationScreenModels.swift

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
// Please see LICENSE in the repository root for full details.
66
//
77

8-
import Foundation
8+
import Compound
9+
import SwiftUI
910

1011
enum SessionVerificationScreenViewModelAction {
1112
case finished
@@ -26,32 +27,32 @@ struct SessionVerificationScreenViewState: BindableState {
2627
let flow: SessionVerificationScreenFlow
2728
var verificationState: SessionVerificationScreenStateMachine.State
2829

29-
var headerImageName: String {
30+
var headerIcon: (keyPath: KeyPath<CompoundIcons, Image>, style: BigIcon.Style) {
3031
switch verificationState {
3132
case .initial:
32-
return "lock"
33+
return (\.devices, .defaultSolid)
3334
case .acceptingVerificationRequest:
34-
return "hourglass"
35+
return (\.devices, .defaultSolid)
3536
case .requestingVerification:
36-
return "hourglass"
37+
return (\.devices, .defaultSolid)
3738
case .verificationRequestAccepted:
38-
return "face.smiling"
39+
return (\.reaction, .defaultSolid)
3940
case .startingSasVerification:
40-
return "hourglass"
41+
return (\.devices, .defaultSolid)
4142
case .sasVerificationStarted:
42-
return "hourglass"
43+
return (\.devices, .defaultSolid)
4344
case .cancelling:
44-
return "hourglass"
45+
return (\.lockSolid, .defaultSolid)
46+
case .showingChallenge:
47+
return (\.reaction, .defaultSolid)
4548
case .acceptingChallenge:
46-
return "hourglass"
49+
return (\.reaction, .defaultSolid)
4750
case .decliningChallenge:
48-
return "hourglass"
49-
case .showingChallenge:
50-
return "face.smiling"
51+
return (\.reaction, .defaultSolid)
5152
case .verified:
52-
return "checkmark.shield"
53+
return (\.checkCircleSolid, .successSolid)
5354
case .cancelled:
54-
return "exclamationmark.shield"
55+
return (\.infoSolid, .alertSolid)
5556
}
5657
}
5758

@@ -60,12 +61,12 @@ struct SessionVerificationScreenViewState: BindableState {
6061
case .initial:
6162
switch flow {
6263
case .initiator:
63-
return L10n.screenSessionVerificationOpenExistingSessionTitle
64+
return L10n.screenSessionVerificationUseAnotherDeviceTitle
6465
case .responder:
6566
return L10n.screenSessionVerificationRequestTitle
6667
}
6768
case .acceptingVerificationRequest:
68-
return L10n.screenSessionVerificationRequestTitle
69+
return L10n.screenSessionVerificationWaitingAnotherDeviceTitle
6970
case .requestingVerification:
7071
return L10n.screenSessionVerificationWaitingToAcceptTitle
7172
case .verificationRequestAccepted:
@@ -98,12 +99,12 @@ struct SessionVerificationScreenViewState: BindableState {
9899
case .initial:
99100
switch flow {
100101
case .initiator:
101-
return L10n.screenSessionVerificationOpenExistingSessionSubtitle
102+
return L10n.screenSessionVerificationUseAnotherDeviceSubtitle
102103
case .responder:
103104
return L10n.screenSessionVerificationRequestSubtitle
104105
}
105106
case .acceptingVerificationRequest:
106-
return L10n.screenSessionVerificationRequestSubtitle
107+
return L10n.screenSessionVerificationWaitingAnotherDeviceSubtitle
107108
case .requestingVerification:
108109
return L10n.screenSessionVerificationWaitingToAcceptSubtitle
109110
case .verificationRequestAccepted:

ElementX/Sources/Screens/Onboarding/SessionVerificationScreen/View/SessionVerificationScreen.swift

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,10 @@ struct SessionVerificationScreen: View {
3131
@ViewBuilder
3232
private var screenHeader: some View {
3333
VStack(spacing: 0) {
34-
if context.viewState.verificationState == .initial {
35-
BigIcon(icon: \.lockSolid)
36-
.padding(.bottom, 16)
37-
} else {
38-
Image(systemName: context.viewState.headerImageName)
39-
.bigIcon()
40-
.padding(.bottom, 16)
41-
}
42-
34+
BigIcon(icon: context.viewState.headerIcon.keyPath,
35+
style: context.viewState.headerIcon.style)
36+
.padding(.bottom, 16)
37+
4338
Text(context.viewState.title ?? "")
4439
.font(.compound.headingMDBold)
4540
.multilineTextAlignment(.center)
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)