Skip to content

Commit

Permalink
Merge pull request #943 from Infomaniak/fix-menu-chevron
Browse files Browse the repository at this point in the history
refactor(ChevronIcon): Update chevron color to 666666
  • Loading branch information
valentinperignon committed Aug 23, 2023
2 parents 87d31b7 + b51b1eb commit b4d6ac7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 25 deletions.
21 changes: 1 addition & 20 deletions Mail/Components/ChevronIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,13 @@ struct ChevronIcon: View {
}
}

enum Color {
case primary, secondary

var color: MailResourcesColors {
switch self {
case .primary:
return MailResourcesAsset.textPrimaryColor
case .secondary:
return MailResourcesAsset.textSecondaryColor
}
}
}

let style: Style
let color: Color

init(style: Style, color: Color = .secondary) {
self.style = style
self.color = color
}

var body: some View {
MailResourcesAsset.arrowUp.swiftUIImage
.resizable()
.frame(width: 12, height: 12)
.foregroundColor(color.color)
.foregroundColor(MailResourcesAsset.textSecondaryColor)
.padding(.vertical, 2)
.padding(.horizontal, 1.5)
.rotationEffect(style.rotationAngle)
Expand Down
2 changes: 1 addition & 1 deletion Mail/Views/Menu Drawer/Folders/FolderCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ struct FolderCellContent: View {
HStack(spacing: UIConstants.menuDrawerHorizontalItemSpacing) {
if canCollapseSubFolders && cellType == .menuDrawer {
Button(action: collapseFolder) {
ChevronIcon(style: folder.isExpanded ? .up : .down, color: .secondary)
ChevronIcon(style: folder.isExpanded ? .up : .down)
}
.opacity(level == 0 && !folder.children.isEmpty ? 1 : 0)
.accessibilityLabel(MailResourcesStrings.Localizable.contentDescriptionButtonExpandFolder(folder.name))
Expand Down
2 changes: 1 addition & 1 deletion Mail/Views/Menu Drawer/Folders/UserFoldersListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct UserFoldersListView: View {
}
} label: {
HStack(spacing: 12) {
ChevronIcon(style: isExpanded ? .up : .down, color: .secondary)
ChevronIcon(style: isExpanded ? .up : .down)
Text(MailResourcesStrings.Localizable.buttonFolders)
.textStyle(.bodySmallSecondary)
Spacer()
Expand Down
2 changes: 1 addition & 1 deletion Mail/Views/Menu Drawer/Items/MenuDrawerItemsListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ struct MenuDrawerItemsListView<Content: View>: View {
}
} label: {
HStack(spacing: 12) {
ChevronIcon(style: isExpanded ? .up : .down, color: .secondary)
ChevronIcon(style: isExpanded ? .up : .down)
Text(title)
.textStyle(.bodySmallSecondary)
Spacer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct MailboxesManagementView: View {
.lineLimit(1)
Spacer()
if hasOtherMailboxes {
ChevronIcon(style: navigationDrawerState.showMailboxes ? .up : .down, color: .primary)
ChevronIcon(style: navigationDrawerState.showMailboxes ? .up : .down)
}
}
.environment(\.isEnabled, true)
Expand Down
2 changes: 1 addition & 1 deletion Mail/Views/Settings/SettingsSubMenuCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct SettingsSubMenuCell<Content: View>: View {
}
}
Spacer()
ChevronIcon(style: .right, color: .secondary)
ChevronIcon(style: .right)
}
}
}
Expand Down

0 comments on commit b4d6ac7

Please sign in to comment.