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-1399 Persona List Fixes #480

Merged
merged 2 commits into from
May 8, 2023
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
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