-
-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathAddOrCreateWizardDisplayMode.swift
108 lines (88 loc) · 2.37 KB
/
AddOrCreateWizardDisplayMode.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
//
// AddOrCreateWizardDisplayMode.swift
// Strongbox
//
// Created by Strongbox on 17/08/2024.
// Copyright © 2024 Mark McGuill. All rights reserved.
//
import SwiftUI
enum AddOrCreateWizardDisplayMode {
case passkey
case totp
var itemName: LocalizedStringKey {
switch self {
case .passkey:
"generic_noun_passkey"
case .totp:
"generic_fieldname_totp"
}
}
var title: LocalizedStringKey {
switch self {
case .passkey:
"passkey_new_passkey_title"
case .totp:
"totp_new_passkey_title"
}
}
var overwriteQuestion: LocalizedStringKey {
switch self {
case .passkey:
"passkey_overwrite_question_title"
case .totp:
"totp_overwrite_question_title"
}
}
var addExistingTitle: LocalizedStringKey {
#if os(iOS)
switch self {
case .passkey:
"passkey_select_existing_entry"
case .totp:
"totp_select_existing_entry"
}
#else
"add_to_entry_or_create_new"
#endif
}
var overwriteQuestionMsgFmt: String {
switch self {
case .passkey:
NSLocalizedString("passkey_overwrite_existing_question_msg_fmt", comment: "")
case .totp:
NSLocalizedString("totp_overwrite_existing_question_msg_fmt", comment: "")
}
}
var questionMsgFmt: String {
switch self {
case .passkey:
NSLocalizedString("passkeys_are_you_sure_add_to_fmt", comment: "Are you sure you want to add this passkey to '%@'?")
case .totp:
NSLocalizedString("totps_are_you_sure_add_to_fmt", comment: "Are you sure you want to add this 2FA Code to '%@'?")
}
}
var createSubtitle: LocalizedStringKey {
switch self {
case .passkey:
"passkey_new_entry_text"
case .totp:
"totp_new_entry_text"
}
}
var subtitle: LocalizedStringKey {
switch self {
case .passkey:
"passkey_how_to_add_to_database"
case .totp:
"totp_how_to_add_to_database"
}
}
var icon: String {
switch self {
case .passkey:
"person.badge.key.fill"
case .totp:
"timer"
}
}
}