ios: adjust compose view background color to match top bar (#4456)

This commit is contained in:
spaced4ndy
2024-07-15 11:20:26 +04:00
committed by GitHub
parent 5c02e1bd19
commit c4ed46c7a4
@@ -377,7 +377,7 @@ struct ComposeView: View {
}
}
}
.background(Color(uiColor: .tertiarySystemGroupedBackground))
.background(BlurView(style: .systemThinMaterial).ignoresSafeArea())
.onChange(of: composeState.message) { msg in
if composeState.linkPreviewAllowed {
if msg.count > 0 {
@@ -1114,6 +1114,17 @@ func parsedMsgHasSimplexLink(_ parsedMsg: [FormattedText]) -> Bool {
parsedMsg.contains(where: { ft in ft.format?.isSimplexLink ?? false })
}
struct BlurView: UIViewRepresentable {
let style: UIBlurEffect.Style
func makeUIView(context: Context) -> UIVisualEffectView {
let view = UIVisualEffectView(effect: UIBlurEffect(style: style))
return view
}
func updateUIView(_ uiView: UIVisualEffectView, context: Context) {}
}
struct ComposeView_Previews: PreviewProvider {
static var previews: some View {
let chat = Chat(chatInfo: ChatInfo.sampleData.direct, chatItems: [])