Skip to content

Commit

Permalink
ABW-1399 Persona List Fixes (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
kugel3 committed May 8, 2023
1 parent 54d1197 commit 8b17f90
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Sources/Core/Resources/Generated/L10n.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,8 @@ public enum L10n {
public static func personaDataSharingDescription(_ p1: Any) -> String {
return L10n.tr("Localizable", "personaDetails.personaDataSharingDescription", String(describing: p1), fallback: "Here is the personal data that you are sharing with %@")
}
/// Persona Name
public static let personaNameHeading = L10n.tr("Localizable", "personaDetails.personaNameHeading", fallback: "Persona Name")
/// Persona Label
public static let personaLabelHeading = L10n.tr("Localizable", "personaDetails.personaLabelHeading", fallback: "Persona Label")
/// Phone Number
public static let phoneNumberHeading = L10n.tr("Localizable", "personaDetails.phoneNumberHeading", fallback: "Phone Number")
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/Core/Resources/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@
"dAppDetails.forgetDappAlertConfirm" = "Forget";
"dAppDetails.forgetDappAlertCancel" = "Cancel";

"personaDetails.personaNameHeading" = "Persona Name";
"personaDetails.personaLabelHeading" = "Persona Label";
"personaDetails.notSharingAnything" = "You are not sharing any personal data with %@";
"personaDetails.personaDataSharingDescription" = "Here is the personal data that you are sharing with %@";
"personaDetails.editPersona" = "Edit Persona";
"personaDetails.firstNameHeading" = "First Name";
"personaDetails.lastNameHeading" = "Last Name";
"personaDetails.emailAddressHeading" = "Email Address";
"personaDetails.phoneNumberHeading" = "Phone Number";
"personaDetails.notSharingAnything" = "You are not sharing any personal data with %@";

"personaDetails.accountSharingDescription" = "Here are the account names and addresses that you are currently sharing with %@.";
"personaDetails.authorizedDappsDescription" = "Here are the dApps you have logged into with this persona.";
Expand Down
2 changes: 1 addition & 1 deletion Sources/Features/EditPersonaFeature/EditPersonaField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public typealias EditPersonaStaticField = EditPersonaField<EditPersona.State.Sta
extension EditPersona.State.StaticFieldID: EditPersonaFieldID {
public var title: String {
switch self {
case .personaLabel: return L10n.PersonaDetails.personaNameHeading
case .personaLabel: return L10n.PersonaDetails.personaLabelHeading
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ extension PersonaDetails.View {
var body: some View {
WithViewStore(store, observe: \.infoSectionViewState) { viewStore in
VStack(alignment: .leading, spacing: .medium1) {
VPair(heading: L10n.PersonaDetails.personaNameHeading, item: viewStore.personaName)
VPair(heading: L10n.PersonaDetails.personaLabelHeading, item: viewStore.personaName)

Separator()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public struct PersonasCoordinator: Sendable, FeatureReducer {

public enum ViewAction: Sendable, Equatable {
case appeared
case dismissPersonaTapped
}

public enum InternalAction: Sendable & Equatable {
Expand Down Expand Up @@ -66,6 +67,9 @@ public struct PersonasCoordinator: Sendable, FeatureReducer {
switch viewAction {
case .appeared:
return checkIfFirstPersonaByUserEver()
case .dismissPersonaTapped:
state.personaDetails = nil
return .none
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,21 @@ extension PersonasCoordinator {
state: \.$personaDetails,
action: { .child(.personaDetails($0)) }
),
content: { PersonaDetails.View(store: $0) }
content: { personaDetailsStore in
NavigationStack {
PersonaDetails.View(store: personaDetailsStore)
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
#endif
.toolbar {
ToolbarItem(placement: .primaryAction) {
CloseButton {
ViewStore(store).send(.view(.dismissPersonaTapped))
}
}
}
}
}
)
}
}
Expand Down

0 comments on commit 8b17f90

Please sign in to comment.