Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweak the session verification icons and copy. #3495

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
// Please see LICENSE in the repository root for full details.
//

import Foundation
import Compound
import SwiftUI

enum SessionVerificationScreenViewModelAction {
case finished
Expand All @@ -26,32 +27,32 @@ struct SessionVerificationScreenViewState: BindableState {
let flow: SessionVerificationScreenFlow
var verificationState: SessionVerificationScreenStateMachine.State

var headerImageName: String {
var headerIcon: (keyPath: KeyPath<CompoundIcons, Image>, style: BigIcon.Style) {
switch verificationState {
case .initial:
return "lock"
return (\.devices, .defaultSolid)
case .acceptingVerificationRequest:
return "hourglass"
return (\.devices, .defaultSolid)
case .requestingVerification:
return "hourglass"
return (\.devices, .defaultSolid)
case .verificationRequestAccepted:
return "face.smiling"
return (\.reaction, .defaultSolid)
case .startingSasVerification:
return "hourglass"
return (\.devices, .defaultSolid)
case .sasVerificationStarted:
return "hourglass"
return (\.devices, .defaultSolid)
case .cancelling:
return "hourglass"
return (\.lockSolid, .defaultSolid)
case .showingChallenge:
return (\.reaction, .defaultSolid)
case .acceptingChallenge:
return "hourglass"
return (\.reaction, .defaultSolid)
case .decliningChallenge:
return "hourglass"
case .showingChallenge:
return "face.smiling"
return (\.reaction, .defaultSolid)
case .verified:
return "checkmark.shield"
return (\.checkCircleSolid, .successSolid)
case .cancelled:
return "exclamationmark.shield"
return (\.infoSolid, .alertSolid)
}
}

Expand All @@ -60,12 +61,12 @@ struct SessionVerificationScreenViewState: BindableState {
case .initial:
switch flow {
case .initiator:
return L10n.screenSessionVerificationOpenExistingSessionTitle
return L10n.screenSessionVerificationUseAnotherDeviceTitle
case .responder:
return L10n.screenSessionVerificationRequestTitle
}
case .acceptingVerificationRequest:
return L10n.screenSessionVerificationRequestTitle
return L10n.screenSessionVerificationWaitingAnotherDeviceTitle
case .requestingVerification:
return L10n.screenSessionVerificationWaitingToAcceptTitle
case .verificationRequestAccepted:
Expand Down Expand Up @@ -98,12 +99,12 @@ struct SessionVerificationScreenViewState: BindableState {
case .initial:
switch flow {
case .initiator:
return L10n.screenSessionVerificationOpenExistingSessionSubtitle
return L10n.screenSessionVerificationUseAnotherDeviceSubtitle
case .responder:
return L10n.screenSessionVerificationRequestSubtitle
}
case .acceptingVerificationRequest:
return L10n.screenSessionVerificationRequestSubtitle
return L10n.screenSessionVerificationWaitingAnotherDeviceSubtitle
case .requestingVerification:
return L10n.screenSessionVerificationWaitingToAcceptSubtitle
case .verificationRequestAccepted:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,10 @@ struct SessionVerificationScreen: View {
@ViewBuilder
private var screenHeader: some View {
VStack(spacing: 0) {
if context.viewState.verificationState == .initial {
BigIcon(icon: \.lockSolid)
.padding(.bottom, 16)
} else {
Image(systemName: context.viewState.headerImageName)
.bigIcon()
.padding(.bottom, 16)
}

BigIcon(icon: context.viewState.headerIcon.keyPath,
style: context.viewState.headerIcon.style)
.padding(.bottom, 16)

Text(context.viewState.title ?? "")
.font(.compound.headingMDBold)
.multilineTextAlignment(.center)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading