make description collapsible

This commit is contained in:
Toni Förster
2023-11-20 21:51:28 +01:00
parent e78f40c555
commit a57645f824
2 changed files with 10 additions and 19 deletions

View File

@@ -243,6 +243,9 @@ struct VideoDetails: View {
}
})
.background(colorScheme == .dark ? Color.black : .white)
.onAppear {
descriptionExpanded = expandVideoDescription
}
}
#if os(iOS)
@@ -409,11 +412,11 @@ struct VideoDetails: View {
var descriptionHeader: some View {
HStack {
Text("Description".localized())
if !expandVideoDescription, !descriptionExpanded {
Spacer()
Image(systemName: "arrow.up.and.down")
.imageScale(.small)
Spacer()
Button { descriptionExpanded.toggle()
} label: {
Image(systemName: descriptionExpanded ? "chevron.up" : "chevron.down")
.imageScale(.small)
}
}
.padding(.horizontal)