Merge branch 'gil/SP1_space_creation' into gil/5231_SP3-1_Update_room_settings_for_Spaces

# Conflicts:
#	Riot/Modules/Spaces/SpaceRoomList/ExploreRoomCoordinator.swift
#	RiotSwiftUI/Modules/Spaces/MatrixItemChooser/View/MatrixItemChooser.swift
This commit is contained in:
Gil Eluard
2022-02-21 15:27:05 +01:00
25 changed files with 181 additions and 123 deletions
@@ -27,22 +27,32 @@ struct AddRoomSelector: View {
@Environment(\.theme) private var theme: ThemeSwiftUI
@ViewBuilder
// MARK: Setup
var body: some View {
MatrixItemChooser(viewModel: viewModel, listBottomPadding: nil)
.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)
}
}