mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-01 00:56:05 +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>
35 lines
875 B
Swift
35 lines
875 B
Swift
//
|
|
// MessageView.swift
|
|
// SimpleX
|
|
//
|
|
// Created by Evgeny Poberezkin on 18/01/2022.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct MessageView: View {
|
|
var message: String
|
|
var sent: Bool
|
|
let receivedColor: Color = Color(UIColor(red: 240/255, green: 240/255, blue: 240/255, alpha: 1.0))
|
|
|
|
var body: some View {
|
|
Text(message)
|
|
.padding(10)
|
|
.foregroundColor(sent ? Color.white : Color.black)
|
|
.background(sent ? Color.blue : receivedColor)
|
|
.cornerRadius(10)
|
|
.frame(minWidth: 100,
|
|
maxWidth: .infinity,
|
|
minHeight: 0,
|
|
maxHeight: .infinity,
|
|
alignment: .leading)
|
|
|
|
}
|
|
}
|
|
|
|
struct MessageView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
MessageView(message: "> Send message: \"Hello world!\"\nSuccessful", sent: false)
|
|
}
|
|
}
|