mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
* initial mobile app design draft * add proposals * xcode project * refactor function to send to view as parameter * export C interface * remove unused files * run chat from chatInit * split chatStart to a separate function * replace file-embed with QQ * add mobile views * server using IP address * pass dbFilePrefix as parameter to chatInit * comment on enabling logging * fix mobile db config * update C API, make user non-optional in ChatController * restore SMP server addresses * revert the change in the tests * flip dependency - now Controller depends on Terminal * make ChatController independent of terminal package * fix Main.hs * add iOS .gitignore * refactor Simplex.Chat.Terminal Co-authored-by: Efim Poberezkin <8711996+efim-poberezkin@users.noreply.github.com>
50 lines
1.3 KiB
Swift
50 lines
1.3 KiB
Swift
//
|
|
// ContentView.swift
|
|
// Shared
|
|
//
|
|
// Created by Evgeny Poberezkin on 17/01/2022.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@State var messages: [String] = ["Start session:"]
|
|
@State var text: String = ""
|
|
|
|
func sendMessage() {
|
|
}
|
|
|
|
var body: some View {
|
|
VStack {
|
|
ScrollView {
|
|
LazyVStack {
|
|
ForEach(messages, id: \.self) { msg in
|
|
MessageView(message: msg, sent: false)
|
|
}
|
|
}
|
|
.padding(10)
|
|
}
|
|
.frame(minWidth: 0,
|
|
maxWidth: .infinity,
|
|
minHeight: 0,
|
|
maxHeight: .infinity,
|
|
alignment: .topLeading)
|
|
HStack {
|
|
TextField("Message...", text: $text)
|
|
.textFieldStyle(RoundedBorderTextFieldStyle())
|
|
.frame(minHeight: CGFloat(30))
|
|
Button(action: sendMessage) {
|
|
Text("Send")
|
|
}.disabled(text.isEmpty)
|
|
}
|
|
.frame(minHeight: CGFloat(30))
|
|
.padding()
|
|
}
|
|
}
|
|
}
|
|
|
|
struct ContentView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
ContentView(text: "Hello!")
|
|
}
|
|
}
|