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-1750] MFA: list and create securitystructures from settings #580

Merged
4 changes: 2 additions & 2 deletions Sources/Core/DesignSystem/JSONView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public struct JSONView: SwiftUI.View {
public var body: some View {
#if canImport(UIKit)
UIKitJSONView(jsonString: jsonString)
.padding([.leading], -60) // we hide the "line number" view on the left which eats up precious widdth,zoo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for brackets, it's an OptionSet

#else
Text("`\(jsonString)`")
#endif
Expand All @@ -27,8 +28,7 @@ struct UIKitJSONView: UIViewRepresentable {
let jsonPreview: JSONPreview
init(jsonString: String) {
let jsonPreview = JSONPreview()
var style = HighlightStyle.default
jsonPreview.preview(jsonString, style: style)
jsonPreview.preview(jsonString, style: .default)
self.jsonPreview = jsonPreview
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,9 @@ extension DebugInspectProfile {

public var body: some SwiftUI.View {
WithViewStore(store, observe: \.viewState, send: { .view($0) }) { viewStore in
GeometryReader { geoProxy in
ZStack {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the ZStack affect the layout? It shouldn't be needed otherwise, since if let ... else is a legitimate view builder pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-06-13 at 11 47 56

Resolved using Group instead. I was 50-50 between both. Don't know if there is any advantage with the one over the other..? Group is probably more performant/lightweight? not sure if it has drawbacks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, didn't see the .toolbar, then it makes sense. I would prefer Group since we're not using z here. Or put the main bit in a func core(viewStore: ...).

if let json = viewStore.json, viewStore.mode == .rawJSON {
let xOffset: CGFloat = 50
JSONView(jsonString: json)
.frame(
width: geoProxy.frame(in: .global).width + xOffset,
height: geoProxy.frame(in: .global).height
)
.offset(x: -xOffset)
} else {
ProfileView(profile: viewStore.profile)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extension SecurityStructureConfigurationRow {
.textStyle(.secondaryHeader)
.padding(.bottom, .small1)

// FIXME: Strings
LabelledDate(label: "Created", date: viewStore.createdOn)
CyonAlexRDX marked this conversation as resolved.
Show resolved Hide resolved
.padding(.bottom, .small3)
}
Expand Down