Skip to content

Commit

Permalink
Persona details update
Browse files Browse the repository at this point in the history
  • Loading branch information
GhenadieVP committed Jul 23, 2023
1 parent c90fc66 commit 0a93387
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extension View {
extension Text {
/// Text formatted as a section heading
public var sectionHeading: some View {
textStyle(.body1Link)
textStyle(.body1Header)
.foregroundColor(.app.gray2)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ extension EditPersonaEntries {

IfLetStore(
store.scope(
state: \.emailAddress,
state: \.phoneNumber,
action: (/Action.child
.. EditPersonaEntries.ChildAction.emailAddress
.. EditPersonaEntries.ChildAction.phoneNumber
).embed
)
) { store in
Expand All @@ -44,9 +44,9 @@ extension EditPersonaEntries {

IfLetStore(
store.scope(
state: \.phoneNumber,
state: \.emailAddress,
action: (/Action.child
.. EditPersonaEntries.ChildAction.phoneNumber
.. EditPersonaEntries.ChildAction.emailAddress
).embed
)
) { store in
Expand Down
31 changes: 18 additions & 13 deletions Sources/Features/PersonaDetailsFeature/PersonaDetails+View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -360,23 +360,28 @@ extension PersonaDetails.View {
}
}

Group {
if let fullName = viewStore.fullName {
VPair(
heading: "Full Name", // FIXME: Localize
item: fullName
)
}
if let fullName = viewStore.fullName {
VPair(
heading: "Full Name", // FIXME: Localize
item: fullName
)
Separator()
}

if let emailAddress = viewStore.emailAddresses?.first {
Text("Email").font(.app.sectionHeader)
VPair(heading: L10n.AuthorizedDapps.PersonaDetails.emailAddress, item: emailAddress)
if let phoneNumber = viewStore.phoneNumbers?.first {
VPair(
heading: L10n.AuthorizedDapps.PersonaDetails.phoneNumber,
item: phoneNumber
)
Separator()
}

if let phoneNumber = viewStore.phoneNumbers?.first {
Text("Phone number").font(.app.sectionHeader)
VPair(heading: L10n.AuthorizedDapps.PersonaDetails.phoneNumber, item: phoneNumber)
if let emailAddress = viewStore.emailAddresses?.first {
VPair(
heading: L10n.AuthorizedDapps.PersonaDetails.emailAddress,
item: emailAddress
)
Separator()
}
}
.padding(.horizontal, .medium1)
Expand Down

0 comments on commit 0a93387

Please sign in to comment.