Skip to content

Commit 859282c

Browse files
authored
Поправил цвет фона экрана чатов (#117)
1 parent 4ee9cbd commit 859282c

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

SwiftUI-WorkoutApp/Screens/Messages/DialogList/DialogListView.swift

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,22 @@ private extension DialogListView {
9494
: "Найти пользователя"
9595
}
9696

97+
@ViewBuilder
9798
var dialogList: some View {
98-
List {
99-
ForEach(viewModel.list) { model in
100-
dialogListItem(model)
101-
.listRowInsets(.init(top: 12, leading: 16, bottom: 12, trailing: 16))
102-
.listRowBackground(Color.swBackground)
103-
.listRowSeparator(.hidden)
99+
if viewModel.list.isEmpty {
100+
Color.swBackground
101+
} else {
102+
List {
103+
ForEach(viewModel.list) { model in
104+
dialogListItem(model)
105+
.listRowInsets(.init(top: 12, leading: 16, bottom: 12, trailing: 16))
106+
.listRowBackground(Color.swBackground)
107+
.listRowSeparator(.hidden)
108+
}
109+
.onDelete(perform: initiateDeletion)
104110
}
105-
.onDelete(perform: initiateDeletion)
111+
.listStyle(.plain)
106112
}
107-
.listStyle(.plain)
108113
}
109114

110115
func dialogListItem(_ model: DialogResponse) -> some View {

0 commit comments

Comments
 (0)