Add the sheet for expanding the space description. (#4475)

* Start working on space description

* Hook up presentation of the SpaceScreenDescriptionView.

* Make the SpaceScreenDescriptionView more accessible and apply a background colour.

* Refactor and move sheet presentation to the header view.

---------

Co-authored-by: amshak <85162587+amshakal@users.noreply.github.com>
This commit is contained in:
Doug
2025-09-08 12:04:17 +01:00
committed by Doug
parent f59928f4d5
commit 20b57d0ad7
10 changed files with 92 additions and 5 deletions
@@ -12,6 +12,8 @@ struct SpaceHeaderView: View {
let spaceRoomProxy: SpaceRoomProxyProtocol
let mediaProvider: MediaProviderProtocol?
@State private var isPresentingTopic = false
var title: String { spaceRoomProxy.name ?? "" }
var body: some View {
@@ -35,11 +37,13 @@ struct SpaceHeaderView: View {
}
if let topic = spaceRoomProxy.topic {
Text(topic)
.font(.compound.bodyMD)
.foregroundStyle(.compound.textPrimary)
.multilineTextAlignment(.center)
.lineLimit(2)
Button { isPresentingTopic = true } label: {
Text(topic)
.font(.compound.bodyMD)
.foregroundStyle(.compound.textPrimary)
.multilineTextAlignment(.center)
.lineLimit(2)
}
}
}
.fixedSize(horizontal: false, vertical: true)
@@ -52,6 +56,11 @@ struct SpaceHeaderView: View {
.fill(Color.compound.borderDisabled)
.frame(height: 1 / UIScreen.main.scale)
}
.sheet(isPresented: $isPresentingTopic) {
if let topic = spaceRoomProxy.topic {
SpaceHeaderTopicSheetView(topic: topic)
}
}
}
var spaceDetails: some View {