SP2: Adding Rooms to Spaces #523o

- update after review
This commit is contained in:
Gil Eluard
2022-02-17 10:47:44 +01:00
parent 6496f732df
commit a09436978a
3 changed files with 26 additions and 13 deletions
@@ -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)
}
}