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

@@ -21,19 +21,7 @@ struct VideoDescription: View {
}
var body: some View {
Group {
if !expandVideoDescription && !expand {
Button {
expand = true
} label: {
descriptionView
}
.buttonStyle(.plain)
} else {
descriptionView
}
}
.id(video.videoID)
descriptionView.id(video.videoID)
}
var descriptionView: some View {
@@ -54,7 +42,7 @@ struct VideoDescription: View {
}
var shouldExpand: Bool {
expandVideoDescription || expand
expand
}
@ViewBuilder var textDescription: some View {