Skip to content

Commit

Permalink
Tweak the session verification icons and copy.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Nov 7, 2024
1 parent e4f346c commit 2f98847
Show file tree
Hide file tree
Showing 53 changed files with 158 additions and 144 deletions.
16 changes: 11 additions & 5 deletions ElementX/Resources/Localizations/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,16 @@
"screen_advanced_settings_element_call_base_url" = "Custom Element Call base URL";
"screen_advanced_settings_element_call_base_url_description" = "Set a custom base URL for Element Call.";
"screen_advanced_settings_element_call_base_url_validation_error" = "Invalid URL, please make sure you include the protocol (http/https) and the correct address.";
"screen_create_room_room_access_section_anyone_option_description" = "Anyone can join this room";
"screen_create_room_room_access_section_anyone_option_title" = "Anyone";
"screen_create_room_room_access_section_header" = "Room Access";
"screen_create_room_room_access_section_knocking_option_description" = "Anyone can ask to join the room but an administrator or a moderator will have to accept the request";
"screen_create_room_room_access_section_knocking_option_title" = "Ask to join";
"screen_create_room_room_address_invalid_symbols_error_description" = "Some characters are not allowed. Only letters, digits and the following symbols are supported ! $ & ‘ ( ) * + / ; = ? @ [ ] - . _";
"screen_create_room_room_address_not_available_error_description" = "This room address already exists, please try editing the room address field or change the room name";
"screen_create_room_room_address_section_footer" = "In order for this room to be visible in the public room directory, you will need a room address.";
"screen_create_room_room_address_section_title" = "Room address";
"screen_create_room_room_visibility_section_title" = "Room visibility";
"screen_create_room_access_section_anyone_option_description" = "Anyone can join this room";
"screen_create_room_access_section_anyone_option_title" = "Anyone";
"screen_create_room_access_section_header" = "Room Access";
"screen_create_room_access_section_knocking_option_description" = "Anyone can ask to join the room but an administrator or a moderator will have to accept the request";
"screen_create_room_access_section_knocking_option_title" = "Ask to join";
"screen_join_room_cancel_knock_action" = "Cancel request";
"screen_join_room_cancel_knock_alert_confirmation" = "Yes, cancel";
"screen_join_room_cancel_knock_alert_description" = "Are you sure that you want to cancel your request to join this room?";
Expand Down Expand Up @@ -847,6 +849,10 @@
"screen_session_verification_request_title" = "Verification requested";
"screen_session_verification_they_dont_match" = "They don’t match";
"screen_session_verification_they_match" = "They match";
"screen_session_verification_use_another_device_subtitle" = "Make sure you have the app open in the other device before starting verification from here.";
"screen_session_verification_use_another_device_title" = "Open the app on another verified device";
"screen_session_verification_waiting_another_device_subtitle" = "You should see a popup on the other device. Start the verification from there now.";
"screen_session_verification_waiting_another_device_title" = "Start verification on the other device";
"screen_session_verification_waiting_to_accept_subtitle" = "Accept the request to start the verification process in your other session to continue.";
"screen_session_verification_waiting_to_accept_title" = "Waiting to accept request";
"screen_share_location_title" = "Share location";
Expand Down
32 changes: 22 additions & 10 deletions ElementX/Sources/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1093,16 +1093,6 @@ internal enum L10n {
internal static var screenCreatePollQuestionHint: String { return L10n.tr("Localizable", "screen_create_poll_question_hint") }
/// Create Poll
internal static var screenCreatePollTitle: String { return L10n.tr("Localizable", "screen_create_poll_title") }
/// Anyone can join this room
internal static var screenCreateRoomAccessSectionAnyoneOptionDescription: String { return L10n.tr("Localizable", "screen_create_room_access_section_anyone_option_description") }
/// Anyone
internal static var screenCreateRoomAccessSectionAnyoneOptionTitle: String { return L10n.tr("Localizable", "screen_create_room_access_section_anyone_option_title") }
/// Room Access
internal static var screenCreateRoomAccessSectionHeader: String { return L10n.tr("Localizable", "screen_create_room_access_section_header") }
/// Anyone can ask to join the room but an administrator or a moderator will have to accept the request
internal static var screenCreateRoomAccessSectionKnockingOptionDescription: String { return L10n.tr("Localizable", "screen_create_room_access_section_knocking_option_description") }
/// Ask to join
internal static var screenCreateRoomAccessSectionKnockingOptionTitle: String { return L10n.tr("Localizable", "screen_create_room_access_section_knocking_option_title") }
/// New room
internal static var screenCreateRoomActionCreateRoom: String { return L10n.tr("Localizable", "screen_create_room_action_create_room") }
/// Invite people
Expand All @@ -1118,6 +1108,20 @@ internal enum L10n {
internal static var screenCreateRoomPublicOptionDescription: String { return L10n.tr("Localizable", "screen_create_room_public_option_description") }
/// Public room
internal static var screenCreateRoomPublicOptionTitle: String { return L10n.tr("Localizable", "screen_create_room_public_option_title") }
/// Anyone can join this room
internal static var screenCreateRoomRoomAccessSectionAnyoneOptionDescription: String { return L10n.tr("Localizable", "screen_create_room_room_access_section_anyone_option_description") }
/// Anyone
internal static var screenCreateRoomRoomAccessSectionAnyoneOptionTitle: String { return L10n.tr("Localizable", "screen_create_room_room_access_section_anyone_option_title") }
/// Room Access
internal static var screenCreateRoomRoomAccessSectionHeader: String { return L10n.tr("Localizable", "screen_create_room_room_access_section_header") }
/// Anyone can ask to join the room but an administrator or a moderator will have to accept the request
internal static var screenCreateRoomRoomAccessSectionKnockingOptionDescription: String { return L10n.tr("Localizable", "screen_create_room_room_access_section_knocking_option_description") }
/// Ask to join
internal static var screenCreateRoomRoomAccessSectionKnockingOptionTitle: String { return L10n.tr("Localizable", "screen_create_room_room_access_section_knocking_option_title") }
/// Some characters are not allowed. Only letters, digits and the following symbols are supported ! $ & ‘ ( ) * + / ; = ? @ [ ] - . _
internal static var screenCreateRoomRoomAddressInvalidSymbolsErrorDescription: String { return L10n.tr("Localizable", "screen_create_room_room_address_invalid_symbols_error_description") }
/// This room address already exists, please try editing the room address field or change the room name
internal static var screenCreateRoomRoomAddressNotAvailableErrorDescription: String { return L10n.tr("Localizable", "screen_create_room_room_address_not_available_error_description") }
/// In order for this room to be visible in the public room directory, you will need a room address.
internal static var screenCreateRoomRoomAddressSectionFooter: String { return L10n.tr("Localizable", "screen_create_room_room_address_section_footer") }
/// Room address
Expand Down Expand Up @@ -2078,6 +2082,14 @@ internal enum L10n {
internal static var screenSessionVerificationTheyDontMatch: String { return L10n.tr("Localizable", "screen_session_verification_they_dont_match") }
/// They match
internal static var screenSessionVerificationTheyMatch: String { return L10n.tr("Localizable", "screen_session_verification_they_match") }
/// Make sure you have the app open in the other device before starting verification from here.
internal static var screenSessionVerificationUseAnotherDeviceSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_use_another_device_subtitle") }
/// Open the app on another verified device
internal static var screenSessionVerificationUseAnotherDeviceTitle: String { return L10n.tr("Localizable", "screen_session_verification_use_another_device_title") }
/// You should see a popup on the other device. Start the verification from there now.
internal static var screenSessionVerificationWaitingAnotherDeviceSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_waiting_another_device_subtitle") }
/// Start verification on the other device
internal static var screenSessionVerificationWaitingAnotherDeviceTitle: String { return L10n.tr("Localizable", "screen_session_verification_waiting_another_device_title") }
/// Accept the request to start the verification process in your other session to continue.
internal static var screenSessionVerificationWaitingToAcceptSubtitle: String { return L10n.tr("Localizable", "screen_session_verification_waiting_to_accept_subtitle") }
/// Waiting to accept request
Expand Down
10 changes: 5 additions & 5 deletions ElementX/Sources/Screens/CreateRoom/View/CreateRoomScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ struct CreateRoomScreen: View {

private var roomAccessSection: some View {
Section {
ListRow(label: .plain(title: L10n.screenCreateRoomAccessSectionAnyoneOptionTitle,
description: L10n.screenCreateRoomAccessSectionAnyoneOptionDescription),
ListRow(label: .plain(title: L10n.screenCreateRoomRoomAccessSectionAnyoneOptionTitle,
description: L10n.screenCreateRoomRoomAccessSectionAnyoneOptionDescription),
kind: .selection(isSelected: !context.isKnockingOnly) { context.isKnockingOnly = false })
ListRow(label: .plain(title: L10n.screenCreateRoomAccessSectionKnockingOptionTitle,
description: L10n.screenCreateRoomAccessSectionKnockingOptionDescription),
ListRow(label: .plain(title: L10n.screenCreateRoomRoomAccessSectionKnockingOptionTitle,
description: L10n.screenCreateRoomRoomAccessSectionKnockingOptionDescription),
kind: .selection(isSelected: context.isKnockingOnly) { context.isKnockingOnly = true })
} header: {
Text(L10n.screenCreateRoomAccessSectionHeader.uppercased())
Text(L10n.screenCreateRoomRoomAccessSectionHeader.uppercased())
.compoundListSectionHeader()
}
}
Expand Down
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

0 comments on commit 2f98847

Please sign in to comment.