mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user