chore: Move accountToggleIndicator to Constants

This commit is contained in:
Marcus Kida 2022-11-15 14:09:51 +01:00
parent 3acdbcc2ce
commit 3a2c99c75a
No known key found for this signature in database
GPG Key ID: 19FF64E08013CA40
1 changed files with 5 additions and 2 deletions

View File

@ -16,6 +16,9 @@ import MastodonCore
import MastodonLocalization import MastodonLocalization
final class SidebarViewModel { final class SidebarViewModel {
private enum Constants {
static let accountToggleIndicator = UIImage(systemName: "chevron.up.chevron.down")
}
var disposeBag = Set<AnyCancellable>() var disposeBag = Set<AnyCancellable>()
@ -80,7 +83,7 @@ extension SidebarViewModel {
}() }()
cell.item = SidebarListContentView.Item( cell.item = SidebarListContentView.Item(
isActive: false, isActive: false,
accessoryImage: item == .me ? UIImage(systemName: "chevron.up.chevron.down") : nil, accessoryImage: item == .me ? Constants.accountToggleIndicator : nil,
title: item.title, title: item.title,
image: item.image, image: item.image,
activeImage: item.selectedImage, activeImage: item.selectedImage,
@ -167,7 +170,7 @@ extension SidebarViewModel {
case .compose: case .compose:
let item = SidebarListContentView.Item( let item = SidebarListContentView.Item(
isActive: false, isActive: false,
accessoryImage: self.currentTab == .me ? UIImage(systemName: "chevron.up.chevron.down") : nil, accessoryImage: self.currentTab == .me ? Constants.accountToggleIndicator : nil,
title: L10n.Common.Controls.Actions.compose, title: L10n.Common.Controls.Actions.compose,
image: Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate), image: Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate),
activeImage: Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate), activeImage: Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate),