mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 16:13:42 +02:00
SP2: Adding Rooms to Spaces #523o
- update after review
This commit is contained in:
@@ -27,21 +27,32 @@ struct AddRoomSelector: View {
|
||||
|
||||
@Environment(\.theme) private var theme: ThemeSwiftUI
|
||||
|
||||
// MARK: Setup
|
||||
|
||||
var body: some View {
|
||||
MatrixItemChooser(viewModel: viewModel)
|
||||
.background(theme.colors.background)
|
||||
.navigationBarItems(leading: Button(VectorL10n.cancel, action: {
|
||||
viewModel.send(viewAction: .cancel)
|
||||
})
|
||||
.font(theme.fonts.body)
|
||||
.foregroundColor(theme.colors.accent),
|
||||
trailing: Button(VectorL10n.add, action: {
|
||||
viewModel.send(viewAction: .done)
|
||||
})
|
||||
.font(theme.fonts.body)
|
||||
.foregroundColor(viewModel.viewState.selectedItemIds.isEmpty ? theme.colors.quarterlyContent : theme.colors.accent)
|
||||
.opacity(viewModel.viewState.selectedItemIds.isEmpty ? 0.7 : 1)
|
||||
.disabled(viewModel.viewState.selectedItemIds.isEmpty))
|
||||
.navigationBarItems(leading: cancelButton,
|
||||
trailing: doneButton)
|
||||
}
|
||||
|
||||
// MARK: Private
|
||||
|
||||
private var cancelButton: some View {
|
||||
Button(VectorL10n.cancel, action: {
|
||||
viewModel.send(viewAction: .cancel)
|
||||
})
|
||||
.font(theme.fonts.body)
|
||||
.foregroundColor(theme.colors.accent)
|
||||
}
|
||||
|
||||
private var doneButton: some View {
|
||||
Button(VectorL10n.add, action: {
|
||||
viewModel.send(viewAction: .done)
|
||||
})
|
||||
.font(theme.fonts.body)
|
||||
.foregroundColor(viewModel.viewState.selectedItemIds.isEmpty ? theme.colors.quarterlyContent : theme.colors.accent)
|
||||
.opacity(viewModel.viewState.selectedItemIds.isEmpty ? 0.7 : 1)
|
||||
.disabled(viewModel.viewState.selectedItemIds.isEmpty)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user