aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS/Chat/ServerMessageView.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-11-27 23:38:04 +0100
committerRuben Beltran del Rio <git@r.bdr.sh>2025-11-27 23:38:04 +0100
commit213710bf5bd6413c747bf126db50816ef5de5a6e (patch)
tree912f8cf87955a08077c92fea8ad934f50b7ab975 /Hotline/macOS/Chat/ServerMessageView.swift
parentf466b21dc02f78c984ba6748e703f6780a7a0db4 (diff)
parent6a95b53616a4abfa306ddce43151cf4fefbd20ed (diff)
Merge remote-tracking branch 'upstream/main'
Diffstat (limited to 'Hotline/macOS/Chat/ServerMessageView.swift')
-rw-r--r--Hotline/macOS/Chat/ServerMessageView.swift33
1 files changed, 33 insertions, 0 deletions
diff --git a/Hotline/macOS/Chat/ServerMessageView.swift b/Hotline/macOS/Chat/ServerMessageView.swift
new file mode 100644
index 0000000..6e8f5db
--- /dev/null
+++ b/Hotline/macOS/Chat/ServerMessageView.swift
@@ -0,0 +1,33 @@
+import SwiftUI
+
+struct ServerMessageView: View {
+ let message: String
+
+ var body: some View {
+ HStack(alignment: .center, spacing: 8) {
+ Image("Server Message")
+ .symbolRenderingMode(.multicolor)
+ .resizable()
+ .scaledToFit()
+ .frame(width: 20, height: 20)
+ Text(message)
+ .fontWeight(.semibold)
+ .lineSpacing(4)
+ .multilineTextAlignment(.leading)
+ .textSelection(.enabled)
+ Spacer()
+ }
+ .padding()
+ .frame(maxWidth: .infinity)
+#if os(iOS)
+ .background(Color("Agreement Background"))
+#elseif os(macOS)
+ .background(VisualEffectView(material: .titlebar, blendingMode: .withinWindow))
+#endif
+ .clipShape(RoundedRectangle(cornerRadius: 16, style: .continuous))
+ }
+}
+
+#Preview {
+ ServerMessageView(message: "This server has something important to say.")
+}