cleaner with less clutter
This commit is contained in:
@@ -241,7 +241,7 @@ struct CalculatorView: View {
|
|||||||
let countryCode = rawCountryCode?.uppercased()
|
let countryCode = rawCountryCode?.uppercased()
|
||||||
let regionName = countryCode.flatMap { Locale.current.localizedString(forRegionCode: $0) ?? $0 }
|
let regionName = countryCode.flatMap { Locale.current.localizedString(forRegionCode: $0) ?? $0 }
|
||||||
|
|
||||||
let buttonTitle = regionName.map { "Review parts for \($0)" } ?? "Review parts"
|
let buttonTitle = "Review parts"
|
||||||
let identifier = "bom-\(savedLoad.name)-\(savedLoad.timestamp.timeIntervalSince1970)"
|
let identifier = "bom-\(savedLoad.name)-\(savedLoad.timestamp.timeIntervalSince1970)"
|
||||||
|
|
||||||
return AffiliateLinkInfo(
|
return AffiliateLinkInfo(
|
||||||
@@ -504,10 +504,6 @@ struct CalculatorView: View {
|
|||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private func affiliateLinkSection(info: AffiliateLinkInfo) -> some View {
|
private func affiliateLinkSection(info: AffiliateLinkInfo) -> some View {
|
||||||
VStack(alignment: .leading, spacing: 12) {
|
VStack(alignment: .leading, spacing: 12) {
|
||||||
Text("Need the hardware?")
|
|
||||||
.font(.caption)
|
|
||||||
.foregroundColor(.secondary)
|
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
presentedAffiliateLink = info
|
presentedAffiliateLink = info
|
||||||
} label: {
|
} label: {
|
||||||
@@ -524,12 +520,6 @@ struct CalculatorView: View {
|
|||||||
}
|
}
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
|
|
||||||
if let regionName = info.regionName {
|
|
||||||
Text("Configured for \(regionName).")
|
|
||||||
.font(.caption2)
|
|
||||||
.foregroundColor(.secondary)
|
|
||||||
}
|
|
||||||
|
|
||||||
Text(info.affiliateURL != nil ? "Tapping above shows a full bill of materials before opening the affiliate link. Purchases may support VoltPlan." : "Tapping above shows a full bill of materials with shopping searches to help you source parts.")
|
Text(info.affiliateURL != nil ? "Tapping above shows a full bill of materials before opening the affiliate link. Purchases may support VoltPlan." : "Tapping above shows a full bill of materials with shopping searches to help you source parts.")
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
@@ -850,7 +840,7 @@ private struct BillOfMaterialsView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
Text(info.affiliateURL != nil ? "Purchases through the affiliate link may support VoltPlan." : "Amazon searches are provided to help you source comparable parts.")
|
Text("Purchases through affiliate links may support VoltPlan.")
|
||||||
.font(.footnote)
|
.font(.footnote)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
.padding(.vertical, 4)
|
.padding(.vertical, 4)
|
||||||
|
|||||||
@@ -1256,11 +1256,7 @@ private struct SystemBillOfMaterialsView: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private var footerMessage: String {
|
private var footerMessage: String {
|
||||||
if loads.contains(where: { $0.affiliateURLString != nil }) {
|
return "Purchases through affiliate links may support VoltPlan."
|
||||||
return "Affiliate links may support VoltPlan; other rows open Amazon searches for sourcing guidance."
|
|
||||||
} else {
|
|
||||||
return "Amazon searches are provided to help you source comparable parts for this system."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var dateFormatter: DateFormatter {
|
private var dateFormatter: DateFormatter {
|
||||||
|
|||||||
Reference in New Issue
Block a user