summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/Views/MullvadInfoHeaderView.swift
blob: 3fcbb1f40954ecf7f3bd60c3e8d3cfcd6626ac02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import SwiftUI

struct MullvadInfoHeaderView: View {
    let bodyText: String
    let link: String

    let onTapLink: (() -> Void)?

    var body: some View {
        var headerText: AttributedString {
            var bodyText = AttributedString(bodyText)
            bodyText.foregroundColor = Color(.ContentHeading.textColor)
            var link = AttributedString(link)
            link.foregroundColor = Color(.ContentHeading.linkColor)
            return bodyText + link
        }
        Button {
            onTapLink?()
        } label: {
            Text(headerText)
                .multilineTextAlignment(.leading)
        }
    }
}