50 lines
1.4 KiB
Swift
50 lines
1.4 KiB
Swift
|
import Combine
|
||
|
import Foundation
|
||
|
import Martin
|
||
|
import SwiftUI
|
||
|
|
||
|
struct ConversationSettingsScreen: View {
|
||
|
@Environment(\.router) var router
|
||
|
@EnvironmentObject var messagesStore: MessagesStore
|
||
|
|
||
|
@State private var omemoEnabled = true
|
||
|
|
||
|
var body: some View {
|
||
|
ZStack {
|
||
|
// Background color
|
||
|
Color.Material.Background.light
|
||
|
.ignoresSafeArea()
|
||
|
|
||
|
// Content
|
||
|
VStack(spacing: 0) {
|
||
|
// Header
|
||
|
SharedNavigationBar(
|
||
|
leftButton: .init(
|
||
|
image: Image(systemName: "chevron.left"),
|
||
|
action: {
|
||
|
router.dismissScreen()
|
||
|
}
|
||
|
),
|
||
|
centerText: .init(text: centerText())
|
||
|
)
|
||
|
|
||
|
// Settings list
|
||
|
ScrollView {
|
||
|
LazyVStack(spacing: 0) {
|
||
|
SharedListRow(
|
||
|
iconType: .none,
|
||
|
text: L10n.Conversation.Settings.enableOmemo,
|
||
|
controlType: .switcher(isOn: $omemoEnabled)
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private func centerText() -> String {
|
||
|
// TODO: make center text depend on conversation type in future (chat, group chat, channel, etc.)
|
||
|
L10n.Conversation.Settings.Title.chat
|
||
|
}
|
||
|
}
|