mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-25 19:10:49 +02:00
MESSENGER-5379 dynamic location attribution from style.json
This commit is contained in:
@@ -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")]))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user