설정 페이지 추가
This commit is contained in:
42
SodaLive/Sources/Settings/Terms/TermsView.swift
Normal file
42
SodaLive/Sources/Settings/Terms/TermsView.swift
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// TermsView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 2023/08/10.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import RichText
|
||||
|
||||
struct TermsView: View {
|
||||
|
||||
let isPrivacyPolicy: Bool
|
||||
|
||||
@ObservedObject var viewModel = TermsViewModel()
|
||||
|
||||
var body: some View {
|
||||
BaseView(isLoading: $viewModel.isLoading) {
|
||||
VStack(spacing: 0) {
|
||||
DetailNavigationBar(title: viewModel.title)
|
||||
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
RichText(html: viewModel.description)
|
||||
.frame(width: screenSize().width - 26.7)
|
||||
}
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
if isPrivacyPolicy {
|
||||
viewModel.getPrivacyPolicy()
|
||||
} else {
|
||||
viewModel.getTermsOfService()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct TermsView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
TermsView(isPrivacyPolicy: false)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user