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

[ABW-3932] Factor Source detail view #1427

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
42 changes: 17 additions & 25 deletions RadixWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@
48CFC23F2ADC10D900E77A5C /* PreferenceList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CFBC6E2ADC10D800E77A5C /* PreferenceList.swift */; };
48CFC2402ADC10D900E77A5C /* AccountPreferences+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CFBC6F2ADC10D800E77A5C /* AccountPreferences+Reducer.swift */; };
48CFC2412ADC10D900E77A5C /* DevAccountPreferences+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CFBC712ADC10D800E77A5C /* DevAccountPreferences+Reducer.swift */; };
48CFC2422ADC10D900E77A5C /* UpdateAccountLabel+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CFBC722ADC10D800E77A5C /* UpdateAccountLabel+Reducer.swift */; };
48CFC2432ADC10D900E77A5C /* UpdateAccountLabel+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CFBC732ADC10D800E77A5C /* UpdateAccountLabel+View.swift */; };
48CFC2442ADC10D900E77A5C /* ThirdPartyDeposits+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CFBC752ADC10D800E77A5C /* ThirdPartyDeposits+Reducer.swift */; };
48CFC2452ADC10D900E77A5C /* AddAsset+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CFBC762ADC10D800E77A5C /* AddAsset+Reducer.swift */; };
48CFC2462ADC10D900E77A5C /* AddAssets+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48CFBC772ADC10D800E77A5C /* AddAssets+View.swift */; };
Expand Down Expand Up @@ -764,13 +762,13 @@
5B526AED2C89C3C200AF8B72 /* ResourcesVisibilityClient+Live.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B526AE92C89C3C200AF8B72 /* ResourcesVisibilityClient+Live.swift */; };
5B526AEE2C89C3C200AF8B72 /* ResourcesVisibilityClient+Test.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B526AEA2C89C3C200AF8B72 /* ResourcesVisibilityClient+Test.swift */; };
5B634A942C91D2A0004B2FBC /* ScreenshotPreventing in Frameworks */ = {isa = PBXBuildFile; productRef = 5B634A932C91D2A0004B2FBC /* ScreenshotPreventing */; };
5B634AAE2C92F6EC004B2FBC /* UpdateP2PLinkName+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B634AAD2C92F6EC004B2FBC /* UpdateP2PLinkName+Reducer.swift */; };
5B634AB02C92F6FA004B2FBC /* UpdateP2PLinkName+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B634AAF2C92F6FA004B2FBC /* UpdateP2PLinkName+View.swift */; };
5B6499B72BCFD0E8000F2176 /* SecurityFactors+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6499B52BCFD0E8000F2176 /* SecurityFactors+View.swift */; };
5B6499B82BCFD0E8000F2176 /* SecurityFactors+Reducer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6499B62BCFD0E8000F2176 /* SecurityFactors+Reducer.swift */; };
5B6499BA2BCFDB1E000F2176 /* ShareView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6499B92BCFDB1E000F2176 /* ShareView.swift */; };
5B6E11482C45835900C20F2D /* AccountCard+DataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6E11472C45835900C20F2D /* AccountCard+DataSource.swift */; };
5B704C362D006E7F00AC758C /* CompletionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B704C352D006E7C00AC758C /* CompletionView.swift */; };
5B725D4B2D107BE00040BA22 /* RenameLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B725D492D107BE00040BA22 /* RenameLabel.swift */; };
5B725D4C2D107BE00040BA22 /* RenameLabel+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B725D4A2D107BE00040BA22 /* RenameLabel+View.swift */; };
5B758D4F2BCD5BF700348722 /* Effect+Extra.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B758D4E2BCD5BF700348722 /* Effect+Extra.swift */; };
5B758D532BCD721D00348722 /* SettingsRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B758D522BCD721D00348722 /* SettingsRow.swift */; };
5B758D572BCE7AEC00348722 /* Preferences+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B758D552BCE7AEC00348722 /* Preferences+View.swift */; };
Expand Down Expand Up @@ -1370,8 +1368,6 @@
48CFBC6E2ADC10D800E77A5C /* PreferenceList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferenceList.swift; sourceTree = "<group>"; };
48CFBC6F2ADC10D800E77A5C /* AccountPreferences+Reducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AccountPreferences+Reducer.swift"; sourceTree = "<group>"; };
48CFBC712ADC10D800E77A5C /* DevAccountPreferences+Reducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DevAccountPreferences+Reducer.swift"; sourceTree = "<group>"; };
48CFBC722ADC10D800E77A5C /* UpdateAccountLabel+Reducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UpdateAccountLabel+Reducer.swift"; sourceTree = "<group>"; };
48CFBC732ADC10D800E77A5C /* UpdateAccountLabel+View.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UpdateAccountLabel+View.swift"; sourceTree = "<group>"; };
48CFBC752ADC10D800E77A5C /* ThirdPartyDeposits+Reducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ThirdPartyDeposits+Reducer.swift"; sourceTree = "<group>"; };
48CFBC762ADC10D800E77A5C /* AddAsset+Reducer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AddAsset+Reducer.swift"; sourceTree = "<group>"; };
48CFBC772ADC10D800E77A5C /* AddAssets+View.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AddAssets+View.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2030,13 +2026,13 @@
5B526AE82C89C3C200AF8B72 /* ResourcesVisibilityClient+Interface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ResourcesVisibilityClient+Interface.swift"; sourceTree = "<group>"; };
5B526AE92C89C3C200AF8B72 /* ResourcesVisibilityClient+Live.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ResourcesVisibilityClient+Live.swift"; sourceTree = "<group>"; };
5B526AEA2C89C3C200AF8B72 /* ResourcesVisibilityClient+Test.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "ResourcesVisibilityClient+Test.swift"; sourceTree = "<group>"; };
5B634AAD2C92F6EC004B2FBC /* UpdateP2PLinkName+Reducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UpdateP2PLinkName+Reducer.swift"; sourceTree = "<group>"; };
5B634AAF2C92F6FA004B2FBC /* UpdateP2PLinkName+View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UpdateP2PLinkName+View.swift"; sourceTree = "<group>"; };
5B6499B52BCFD0E8000F2176 /* SecurityFactors+View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SecurityFactors+View.swift"; sourceTree = "<group>"; };
5B6499B62BCFD0E8000F2176 /* SecurityFactors+Reducer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SecurityFactors+Reducer.swift"; sourceTree = "<group>"; };
5B6499B92BCFDB1E000F2176 /* ShareView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareView.swift; sourceTree = "<group>"; };
5B6E11472C45835900C20F2D /* AccountCard+DataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AccountCard+DataSource.swift"; sourceTree = "<group>"; };
5B704C352D006E7C00AC758C /* CompletionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompletionView.swift; sourceTree = "<group>"; };
5B725D492D107BE00040BA22 /* RenameLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RenameLabel.swift; sourceTree = "<group>"; };
5B725D4A2D107BE00040BA22 /* RenameLabel+View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "RenameLabel+View.swift"; sourceTree = "<group>"; };
5B758D4E2BCD5BF700348722 /* Effect+Extra.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Effect+Extra.swift"; sourceTree = "<group>"; };
5B758D522BCD721D00348722 /* SettingsRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsRow.swift; sourceTree = "<group>"; };
5B758D552BCE7AEC00348722 /* Preferences+View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Preferences+View.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2855,8 +2851,6 @@
48CFBC712ADC10D800E77A5C /* DevAccountPreferences+Reducer.swift */,
48CFBC7B2ADC10D800E77A5C /* DevAccountPreferences+View.swift */,
48CFBC742ADC10D800E77A5C /* ThirdPartyDeposits */,
48CFBC722ADC10D800E77A5C /* UpdateAccountLabel+Reducer.swift */,
48CFBC732ADC10D800E77A5C /* UpdateAccountLabel+View.swift */,
);
path = Children;
sourceTree = "<group>";
Expand Down Expand Up @@ -3036,7 +3030,6 @@
48CFBCBF2ADC10D800E77A5C /* P2PLinksFeature */ = {
isa = PBXGroup;
children = (
5B634AAC2C92F6C5004B2FBC /* UpdateP2PLinkName */,
48CFBCC02ADC10D800E77A5C /* Coordinator */,
);
path = P2PLinksFeature;
Expand Down Expand Up @@ -5092,6 +5085,7 @@
48CFC1322ADC10D900E77A5C /* FeaturePrelude */ = {
isa = PBXGroup;
children = (
5B725D482D107BCE0040BA22 /* RenameLabel */,
5B6E11462C45834C00C20F2D /* AccountCard */,
E775A1B62CF4CA0700E72DB9 /* FactorSourceCard */,
48CFC1332ADC10D900E77A5C /* LedgerRowView.swift */,
Expand Down Expand Up @@ -5715,15 +5709,6 @@
path = ResourcesVisibilityClient;
sourceTree = "<group>";
};
5B634AAC2C92F6C5004B2FBC /* UpdateP2PLinkName */ = {
isa = PBXGroup;
children = (
5B634AAD2C92F6EC004B2FBC /* UpdateP2PLinkName+Reducer.swift */,
5B634AAF2C92F6FA004B2FBC /* UpdateP2PLinkName+View.swift */,
);
path = UpdateP2PLinkName;
sourceTree = "<group>";
};
5B6499B42BCFD0C7000F2176 /* SecurityFactors */ = {
isa = PBXGroup;
children = (
Expand All @@ -5746,6 +5731,15 @@
path = AccountCard;
sourceTree = "<group>";
};
5B725D482D107BCE0040BA22 /* RenameLabel */ = {
isa = PBXGroup;
children = (
5B725D492D107BE00040BA22 /* RenameLabel.swift */,
5B725D4A2D107BE00040BA22 /* RenameLabel+View.swift */,
);
path = RenameLabel;
sourceTree = "<group>";
};
5B758D542BCE7AD100348722 /* Preferences */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -7491,7 +7485,6 @@
48CFC25A2ADC10D900E77A5C /* OnboardingCoordinator+Reducer.swift in Sources */,
5BB7C1782BC81F61001216EB /* ImportOlympiaNameLedger+View.swift in Sources */,
48CFC3482ADC10D900E77A5C /* PersonaDataPermission.swift in Sources */,
48CFC2422ADC10D900E77A5C /* UpdateAccountLabel+Reducer.swift in Sources */,
48CFC3432ADC10D900E77A5C /* AccountPermission+View.swift in Sources */,
48CFC2452ADC10D900E77A5C /* AddAsset+Reducer.swift in Sources */,
48CFC42E2ADC10DA00E77A5C /* KeyPath+Sendable.swift in Sources */,
Expand All @@ -7515,7 +7508,6 @@
5B4A1AB32CBFC99200679EE6 /* SignProofOfOwnership.swift in Sources */,
E62449D62AFBA61100272C67 /* Home+AccountRow+View.swift in Sources */,
A40816682C7F14D4005E65B9 /* InfoLinkSheet+Reducer.swift in Sources */,
5B634AAE2C92F6EC004B2FBC /* UpdateP2PLinkName+Reducer.swift in Sources */,
A408154D2C7E0D08005E65B9 /* Extensions.swift in Sources */,
48CFC5FE2ADC10DA00E77A5C /* Account+PreviewValues.swift in Sources */,
A408157C2C7E0D08005E65B9 /* FungibleResourcesCollectionItemVaultAggregatedVault.swift in Sources */,
Expand Down Expand Up @@ -7824,7 +7816,6 @@
83823EA72B722DB000827211 /* HTTPClient+Interface.swift in Sources */,
A40816152C7E0D08005E65B9 /* StateEntityMetadataPageRequest.swift in Sources */,
48CFC5972ADC10DA00E77A5C /* ToggleView.swift in Sources */,
5B634AB02C92F6FA004B2FBC /* UpdateP2PLinkName+View.swift in Sources */,
5B03E3D32CC141D100E10A64 /* InteractionReview+Extra.swift in Sources */,
48CFC4892ADC10DA00E77A5C /* EntityMetadata+GWMetadata.swift in Sources */,
48CFC3512ADC10D900E77A5C /* DappHeader.swift in Sources */,
Expand Down Expand Up @@ -8013,7 +8004,6 @@
A40815D82C7E0D08005E65B9 /* ProgrammaticScryptoSborValueI64.swift in Sources */,
A40815EE2C7E0D08005E65B9 /* ResourceAggregationLevel.swift in Sources */,
48CFC5742ADC10DA00E77A5C /* GatewayAPI+Utils.swift in Sources */,
48CFC2432ADC10D900E77A5C /* UpdateAccountLabel+View.swift in Sources */,
48CFC3182ADC10D900E77A5C /* CreateAccountCoordinator+Models.swift in Sources */,
48CFC2822ADC10D900E77A5C /* SelectFeePayer.swift in Sources */,
48CFC5D52ADC10DA00E77A5C /* TokenShadowModifier.swift in Sources */,
Expand Down Expand Up @@ -8511,6 +8501,8 @@
48CFC5BD2ADC10DA00E77A5C /* Hint.swift in Sources */,
5BBC7DA82C40278E00B04BD6 /* NonFungibleResourceAsset+Reducer.swift in Sources */,
48CFC3622ADC10D900E77A5C /* LedgerHardwareDevices+Reducer.swift in Sources */,
5B725D4B2D107BE00040BA22 /* RenameLabel.swift in Sources */,
5B725D4C2D107BE00040BA22 /* RenameLabel+View.swift in Sources */,
A40816392C7E0D08005E65B9 /* StreamTransactionsRequestEventFilterItem.swift in Sources */,
48CFC2B22ADC10D900E77A5C /* DerivePublicKeys.swift in Sources */,
A40815F02C7E0D08005E65B9 /* ResourceHoldersCollectionFungibleResourceItem.swift in Sources */,
Expand Down Expand Up @@ -9357,7 +9349,7 @@
repositoryURL = "https://github.com/radixdlt/sargon/";
requirement = {
kind = exactVersion;
version = 1.1.88;
version = 1.1.91;
};
};
8318BB172BC8403800057BCB /* XCRemoteSwiftPackageReference "swift-custom-dump" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/radixdlt/sargon/",
"state" : {
"revision" : "9dced921809b0d6e9d417fb12025172eb69fc6d7",
"version" : "1.1.88"
"revision" : "2f60c3985149a3128a7e0e29b19d0544f0f0d365",
"version" : "1.1.91"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ extension OverlayWindowClient {
}

extension OverlayWindowClient.Item.HUD {
static let updatedAccount = Self(text: L10n.AccountSettings.updatedAccountHUDMessage)
static let copied = Self(text: L10n.AddressAction.copiedToClipboard)
static let seedPhraseImported = Self(text: L10n.ImportMnemonic.seedPhraseImported)
static let thankYou = Self(text: "Thank you!")
Expand Down
18 changes: 14 additions & 4 deletions RadixWallet/Core/DesignSystem/Components/PlainListRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,25 +132,26 @@ struct PlainListRowCore: View {
let title: String?
let subtitle: String?
let detail: String?
let markdown: String?

init(
context: Context = .settings,
title: String?,
subtitle: String? = nil,
detail: String? = nil
detail: String? = nil,
markdown: String? = nil
) {
self.context = context
self.title = title
self.subtitle = subtitle
self.detail = detail
self.markdown = markdown
}
}

let viewState: ViewState

init(
viewState: ViewState
) {
init(viewState: ViewState) {
self.viewState = viewState
}

Expand Down Expand Up @@ -185,6 +186,15 @@ struct PlainListRowCore: View {
.foregroundColor(.app.gray2)
.padding(.top, .small3)
}

if let markdown = viewState.markdown {
Text(markdown: markdown, emphasizedColor: .app.gray2, emphasizedFont: .app.body1Header)
.textStyle(.body1Regular)
.lineLimit(1)
.minimumScaleFactor(0.8)
.foregroundStyle(.app.gray2)
.padding(.top, .small3)
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions RadixWallet/Core/DesignSystem/ToggleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ struct ToggleView: SwiftUI.View {
let context: Context
let icon: ImageResource?
let title: String
let subtitle: String
let subtitle: String?
let minHeight: CGFloat
let isOn: Binding<Bool>

init(
context: Context = .toggle,
icon: ImageResource? = nil,
title: String,
subtitle: String,
subtitle: String?,
minHeight: CGFloat = .largeButtonHeight,
isOn: Binding<Bool>
) {
Expand Down
21 changes: 21 additions & 0 deletions RadixWallet/Core/FeaturePrelude/FeatureReducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,25 @@ extension FeatureReducer {
}
return .none
}

func exportMnemonic(
integrity: FactorSourceIntegrity,
onSuccess: (SimplePrivateFactorSource) -> Void
) -> Effect<Action> {
guard let factorSourceId = integrity.factorSourceIdOfMnemonicToExport else {
return .none
}
return exportMnemonic(factorSourceID: factorSourceId, onSuccess: onSuccess)
}
}

private extension FactorSourceIntegrity {
var factorSourceIdOfMnemonicToExport: FactorSourceIdFromHash? {
switch self {
case let .device(device):
device.factorSource.id
case .ledger, .offDeviceMnemonic, .arculusCard, .password:
nil
}
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import SwiftUI

// MARK: - UpdateP2PLinkName.View
extension UpdateP2PLinkName {
@MainActor
// MARK: - RenameLabel.View
extension RenameLabel {
struct View: SwiftUI.View {
@Perception.Bindable var store: StoreOf<UpdateP2PLinkName>
@Perception.Bindable var store: StoreOf<RenameLabel>
@FocusState private var textFieldFocus: Bool

init(store: StoreOf<UpdateP2PLinkName>) {
self.store = store
}

var body: some SwiftUI.View {
content
.withNavigationBar {
Expand All @@ -25,17 +20,17 @@ extension UpdateP2PLinkName {
WithPerceptionTracking {
VStack(spacing: .zero) {
VStack(spacing: .medium1) {
Text(L10n.LinkedConnectors.RenameConnector.title)
Text(store.kind.title)
.textStyle(.sheetTitle)
.multilineTextAlignment(.center)

Text(L10n.LinkedConnectors.RenameConnector.subtitle)
Text(store.kind.subtitle)
.textStyle(.body1Regular)
.multilineTextAlignment(.center)

AppTextField(
placeholder: "",
text: $store.linkName.sending(\.view.linkNameChanged),
text: $store.label.sending(\.view.labelChanged),
hint: store.hint,
focus: .on(
true,
Expand All @@ -55,10 +50,10 @@ extension UpdateP2PLinkName {
.padding(.horizontal, .medium3)
.footer {
WithControlRequirements(
store.sanitizedName,
store.sanitizedLabel,
forAction: { store.send(.view(.updateTapped($0))) }
) { action in
Button(L10n.LinkedConnectors.RenameConnector.update, action: action)
Button(L10n.RenameLabel.update, action: action)
.buttonStyle(.primaryRectangular)
.controlState(store.controlState)
}
Expand All @@ -68,12 +63,45 @@ extension UpdateP2PLinkName {
}
}

private extension UpdateP2PLinkName.State {
private extension RenameLabel.State {
var hint: Hint.ViewState? {
sanitizedName == nil ? .iconError(L10n.LinkedConnectors.RenameConnector.errorEmpty) : nil
switch status {
case .empty:
.iconError(kind.empty)
case .tooLong:
.iconError(L10n.RenameLabel.Account.tooLong)
case .valid:
nil
}
}

var controlState: ControlState {
sanitizedName == nil ? .disabled : .enabled
status == .valid ? .enabled : .disabled
}
}

private extension RenameLabel.State.Kind {
var title: String {
switch self {
case .account: L10n.RenameLabel.Account.title
case .connector: L10n.RenameLabel.Connector.title
case .factorSource: L10n.RenameLabel.FactorSource.title
}
}

var subtitle: String {
switch self {
case .account: L10n.RenameLabel.Account.subtitle
case .connector: L10n.RenameLabel.Connector.subtitle
case .factorSource: L10n.RenameLabel.FactorSource.subtitle
}
}

var empty: String {
switch self {
case .account: L10n.RenameLabel.Account.empty
case .connector: L10n.RenameLabel.Connector.empty
case .factorSource: L10n.RenameLabel.FactorSource.empty
}
}
}
Loading
Loading