MESSENGER-5379 dynamic location attribution from style.json

This commit is contained in:
Frank Rotermund
2024-01-09 11:02:02 +01:00
parent 9c10374575
commit d7749bb5da
12 changed files with 143 additions and 22 deletions
@@ -25,25 +25,41 @@ struct MapCreditsView: View {
// MARK: Public
// MARK: Public
// bwi #5379 use dynamic attributions from style.json
@ObservedObject var attributions:LocationSharingAttribution
var action: (() -> Void)?
var body: some View {
HStack {
Spacer()
Spacer()
Button {
action?()
} label: {
Text(BWIL10n.locationSharingCopyrightLabel)
Text(copyrightText(attribution:attributions))
.font(theme.fonts.footnote)
.foregroundColor(theme.colors.accent)
}
.padding(.horizontal)
}
}
func copyrightText( attribution: LocationSharingAttribution) -> String {
var copyright = ""
for copyrightText in attribution.copyrightTexts {
copyright.append(copyrightText)
}
return copyright
}
}
struct MapCreditsView_Previews: PreviewProvider {
static var previews: some View {
MapCreditsView()
MapCreditsView(attributions: LocationSharingAttribution(copyrightTexts: [""], copyrightLinks: [URL(string: "www.someurl.org")]))
}
}