LiTranslate-iOS/LiTranslate/Presentation/Component/Languages/OutputTranslationView.swift

47 lines
1.4 KiB
Swift
Raw Permalink Normal View History

2022-09-10 19:46:05 +02:00
//
// OutputTranslationView.swift
// LiTranslate
//
// Created by Viktor Kalyniuk on 13.08.2022.
//
import SwiftUI
struct OutputTranslationView: View {
@EnvironmentObject var selection: LanguagesSelection
@EnvironmentObject var textData: TextData
@EnvironmentObject var bookmarksData: BookmarksData
var body: some View {
VStack(alignment: .leading) {
HStack(alignment: .top) {
ScrollView {
Text(textData.output)
.textSelection(.enabled)
.padding()
}
Spacer()
BookmarkButton(bookmarkModel:
BookmarkModel(
inputLanguage: selection.input,
outputLanguage: selection.output,
inputText: textData.input,
outputText: textData.output))
.padding([.top, .trailing])
}
OutputBottomButtons()
}
.background(Colors.Background.primaryView)
.cornerRadius(CGFloat(Numbers.twentyFive))
}
}
struct OutputTranslationView_Previews: PreviewProvider {
static var previews: some View {
OutputTranslationView()
.environmentObject(LanguagesSelection())
.environmentObject(TextData())
.environmentObject(BookmarksData())
}
}