LiTranslate-iOS/LiTranslate/Presentation/Component/LinkView.swift
Viktor Kalyniuk 823b3abe77 release v1.0
2022-09-10 20:46:05 +03:00

33 lines
748 B
Swift

//
// LinkView.swift
// LiTranslate
//
// Created by Viktor Kalyniuk on 05.09.2022.
//
import SwiftUI
struct LinkView: View {
var urlString: String
var title: String
var body: some View {
if let licenseURL = URL(string: urlString) {
Link(destination: licenseURL) {
HStack {
Text(title)
Spacer()
Image(systemName: SystemNames.openLink)
}
}
.listRowBackground(Colors.Background.primaryView)
.foregroundColor(Colors.Foreground.label)
}
}
}
struct LinkView_Previews: PreviewProvider {
static var previews: some View {
LinkView(urlString: "", title: "")
}
}