mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
MediaTimelinePreviewDetails can now be opened by long pressing in the media timeline (#4474)
* presenting media actions from the media timeline * implemented view in timeline and fixed an issue that made dark mode being when trying to delete the file * pr suggestions
This commit is contained in:
+13
-2
@@ -11,11 +11,21 @@ import SwiftUI
|
||||
struct TimelineMediaPreviewDetailsView: View {
|
||||
let item: TimelineMediaPreviewItem.Media
|
||||
@ObservedObject var context: TimelineMediaPreviewViewModel.Context
|
||||
var preferredColorScheme: ColorScheme? = .dark
|
||||
|
||||
@Binding var sheetHeight: CGFloat
|
||||
private let topPadding: CGFloat = 19
|
||||
|
||||
var body: some View {
|
||||
if let preferredColorScheme {
|
||||
mainContent
|
||||
.preferredColorScheme(preferredColorScheme)
|
||||
} else {
|
||||
mainContent
|
||||
}
|
||||
}
|
||||
|
||||
private var mainContent: some View {
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
details
|
||||
@@ -29,9 +39,10 @@ struct TimelineMediaPreviewDetailsView: View {
|
||||
.presentationDetents([.height(sheetHeight + topPadding)])
|
||||
.presentationDragIndicator(.visible)
|
||||
.presentationBackground(.compound.bgCanvasDefault)
|
||||
.preferredColorScheme(.dark)
|
||||
.sheet(item: $context.redactConfirmationItem) { item in
|
||||
TimelineMediaPreviewRedactConfirmationView(item: item, context: context)
|
||||
TimelineMediaPreviewRedactConfirmationView(item: item,
|
||||
context: context,
|
||||
preferredColorScheme: preferredColorScheme)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -13,11 +13,21 @@ struct TimelineMediaPreviewRedactConfirmationView: View {
|
||||
|
||||
let item: TimelineMediaPreviewItem.Media
|
||||
@ObservedObject var context: TimelineMediaPreviewViewModel.Context
|
||||
|
||||
var preferredColorScheme: ColorScheme? = .dark
|
||||
|
||||
@State private var sheetHeight: CGFloat = .zero
|
||||
private let topPadding: CGFloat = 19
|
||||
|
||||
var body: some View {
|
||||
if let preferredColorScheme {
|
||||
mainContent
|
||||
.preferredColorScheme(preferredColorScheme)
|
||||
} else {
|
||||
mainContent
|
||||
}
|
||||
}
|
||||
|
||||
private var mainContent: some View {
|
||||
ScrollView {
|
||||
VStack(spacing: 0) {
|
||||
header
|
||||
@@ -31,7 +41,6 @@ struct TimelineMediaPreviewRedactConfirmationView: View {
|
||||
.presentationDetents([.height(sheetHeight + topPadding)])
|
||||
.presentationDragIndicator(.visible)
|
||||
.presentationBackground(.compound.bgCanvasDefault)
|
||||
.preferredColorScheme(.dark)
|
||||
}
|
||||
|
||||
private var header: some View {
|
||||
|
||||
Reference in New Issue
Block a user