Skip to content

Commit

Permalink
Merge pull request #476 from Infomaniak/menu
Browse files Browse the repository at this point in the history
MailboxesManagementView: Remove buttons manage & switch account
  • Loading branch information
Ambrdctr authored Jan 9, 2023
2 parents 7f03ba5 + 86fd224 commit b5e543e
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,29 +54,22 @@ struct MailboxesManagementView: View {
.textStyle(.bodyMediumAccent)
.lineLimit(1)
Spacer()
ChevronIcon(style: navigationDrawerState.showMailboxes ? .up : .down, color: .primary)
if !otherMailboxes.isEmpty {
ChevronIcon(style: navigationDrawerState.showMailboxes ? .up : .down, color: .primary)
}
}
.environment(\.isEnabled, true)
.padding(.vertical, Constants.menuDrawerVerticalPadding)
.padding(.horizontal, Constants.menuDrawerHorizontalPadding)
.background(SelectionBackground(isSelected: true, offsetX: 8, leadingPadding: 0, verticalPadding: 0))
}
.disabled(otherMailboxes.isEmpty)

if navigationDrawerState.showMailboxes {
VStack(alignment: .leading, spacing: 4) {
ForEach(otherMailboxes) { mailbox in
MailboxCell(mailbox: mailbox)
}

if !otherMailboxes.isEmpty {
IKDivider(withPadding: true)
}

MailboxesManagementButtonView(icon: MailResourcesAsset.userSetting, text: MailResourcesStrings.Localizable.buttonManageAccount) {
isShowingManageAccount.toggle()
}
MailboxesManagementButtonView(icon: MailResourcesAsset.userSwap, text: MailResourcesStrings.Localizable.buttonAccountSwitch) {
isShowingSwitchAccount.toggle()
}
}
.task {
try? await updateAccount()
Expand Down

0 comments on commit b5e543e

Please sign in to comment.