Add button to re-hide sensitive media once expanded (#59)
* Add button to rehide sensitive media once expanded * Update button style to make it easier to see the button depending on background * Fixes Co-authored-by: Thomas Ricouard <ricouard77@gmail.com>
This commit is contained in:
parent
e37addc7d4
commit
a5308730f8
|
@ -149,6 +149,9 @@ public struct StatusMediaPreviewView: View {
|
|||
.shimmering()
|
||||
}
|
||||
}
|
||||
if sensitive {
|
||||
cornerSensitiveButton
|
||||
}
|
||||
if let alt = attachement.description, !alt.isEmpty, !isNotifications {
|
||||
Button {
|
||||
altTextDisplayed = alt
|
||||
|
@ -213,6 +216,9 @@ public struct StatusMediaPreviewView: View {
|
|||
}
|
||||
.frame(width: isNotifications ? imageMaxHeight : proxy.frame(in: .local).width)
|
||||
.frame(height: imageMaxHeight)
|
||||
if sensitive {
|
||||
cornerSensitiveButton
|
||||
}
|
||||
if let alt = attachement.description, !alt.isEmpty, !isNotifications {
|
||||
Button {
|
||||
altTextDisplayed = alt
|
||||
|
@ -280,4 +286,16 @@ public struct StatusMediaPreviewView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var cornerSensitiveButton: some View {
|
||||
Button {
|
||||
withAnimation {
|
||||
isHidingMedia = true
|
||||
}
|
||||
} label: {
|
||||
Image(systemName:"eye.slash")
|
||||
}
|
||||
.position(x: 30, y: 30)
|
||||
.buttonStyle(.borderedProminent)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue