Merge branch 'ismail/5068_start_thread' into ismail/5068_design_tweaks

This commit is contained in:
ismailgulek
2022-01-27 02:01:55 +03:00
10 changed files with 63 additions and 57 deletions
@@ -119,7 +119,7 @@ final class ThreadListViewController: UIViewController {
private func setupViews() {
let titleView = ThreadRoomTitleView.loadFromNib()
titleView.mode = .allThreads
titleView.configure(withViewModel: viewModel.titleViewModel)
titleView.configure(withModel: viewModel.titleModel)
titleView.updateLayout(for: UIApplication.shared.statusBarOrientation)
self.titleView = titleView
navigationItem.leftItemsSupplementBackButton = true
@@ -144,8 +144,8 @@ final class ThreadListViewController: UIViewController {
renderLoading()
case .loaded:
renderLoaded()
case .empty(let viewModel):
renderEmptyView(withViewModel: viewModel)
case .empty(let model):
renderEmptyView(withModel: model)
case .showingFilterTypes:
renderShowingFilterTypes()
case .showingLongPressActions(let index):
@@ -178,9 +178,9 @@ final class ThreadListViewController: UIViewController {
}
}
private func renderEmptyView(withViewModel emptyViewModel: ThreadListEmptyModel) {
private func renderEmptyView(withModel model: ThreadListEmptyModel) {
self.activityPresenter.removeCurrentActivityIndicator(animated: true)
emptyView.configure(withViewModel: emptyViewModel)
emptyView.configure(withModel: model)
threadsTableView.isHidden = true
emptyView.isHidden = false
navigationItem.rightBarButtonItem?.isEnabled = viewModel.selectedFilterType == .myThreads
@@ -332,8 +332,8 @@ extension ThreadListViewController: UITableViewDataSource {
let cell: ThreadTableViewCell = tableView.dequeueReusableCell(for: indexPath)
cell.update(theme: theme)
if let threadVM = viewModel.threadViewModel(at: indexPath.row) {
cell.configure(withViewModel: threadVM)
if let threadModel = viewModel.threadModel(at: indexPath.row) {
cell.configure(withModel: threadModel)
}
return cell