Flatten AppAsset — the inner structs were too cute.

This commit is contained in:
Brent Simmons
2024-09-30 22:16:54 -07:00
parent c88dc18644
commit 2ae6eaba9f
25 changed files with 119 additions and 120 deletions

View File

@@ -133,17 +133,17 @@ final class AddAccountViewController: UITableViewController, AddAccountDismissDe
switch indexPath.section {
case AddAccountSections.local.rawValue:
cell.comboNameLabel?.text = AddAccountSections.local.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppAsset.Account.image(for: .onMyMac)
cell.comboImage?.image = AppAsset.accountImage(for: .onMyMac)
case AddAccountSections.icloud.rawValue:
cell.comboNameLabel?.text = AddAccountSections.icloud.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppAsset.Account.image(for: AddAccountSections.icloud.sectionContent[indexPath.row])
cell.comboImage?.image = AppAsset.accountImage(for: AddAccountSections.icloud.sectionContent[indexPath.row])
if AppDefaults.shared.isDeveloperBuild || AccountManager.shared.accounts.contains(where: { $0.accountType == .cloudKit }) {
cell.isUserInteractionEnabled = false
cell.comboNameLabel?.isEnabled = false
}
case AddAccountSections.web.rawValue:
cell.comboNameLabel?.text = AddAccountSections.web.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppAsset.Account.image(for: AddAccountSections.web.sectionContent[indexPath.row])
cell.comboImage?.image = AppAsset.accountImage(for: AddAccountSections.web.sectionContent[indexPath.row])
let type = AddAccountSections.web.sectionContent[indexPath.row]
if (type == .feedly || type == .inoreader) && AppDefaults.shared.isDeveloperBuild {
cell.isUserInteractionEnabled = false
@@ -151,8 +151,8 @@ final class AddAccountViewController: UITableViewController, AddAccountDismissDe
}
case AddAccountSections.selfhosted.rawValue:
cell.comboNameLabel?.text = AddAccountSections.selfhosted.sectionContent[indexPath.row].localizedAccountName()
cell.comboImage?.image = AppAsset.Account.image(for: AddAccountSections.selfhosted.sectionContent[indexPath.row])
cell.comboImage?.image = AppAsset.accountImage(for: AddAccountSections.selfhosted.sectionContent[indexPath.row])
default:
return cell
}