Skip to content

Commit

Permalink
refactor: Use floatingPanel title
Browse files Browse the repository at this point in the history
  • Loading branch information
Lnamw committed Sep 11, 2024
1 parent 26958a5 commit 0ca32d8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 7 additions & 1 deletion Mail/Components/Custom Buttons/AccountButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
*/

import InfomaniakCore
import InfomaniakDI
import MailCore
import MailCoreUI
import MailResources
import SwiftModalPresentation
import SwiftUI

struct AccountButton: View {
@LazyInjectService private var accountManager: AccountManager

@EnvironmentObject private var mailboxManager: MailboxManager

@State private var isShowingNewAccountListView = false
Expand All @@ -38,7 +41,10 @@ struct AccountButton: View {
.accessibilityLabel(MailResourcesStrings.Localizable.titleMyAccount(1))
}
}
.floatingPanel(isPresented: $isShowingNewAccountListView) {
.floatingPanel(
isPresented: $isShowingNewAccountListView,
title: MailResourcesStrings.Localizable.titleMyAccount(accountManager.accounts.count)
) {
AccountListView(mailboxManager: mailboxManager)
}
}
Expand Down
4 changes: 0 additions & 4 deletions Mail/Views/Switch User/AccountListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ struct AccountListView: View {
var body: some View {
ScrollView {
VStack(spacing: 0) {
Text(MailResourcesStrings.Localizable.titleMyAccount(viewModel.accounts.count))
.textStyle(.bodyMedium)
.padding(.bottom, value: .medium)

VStack(spacing: IKPadding.extraSmall) {
ForEach(Array(viewModel.accounts.keys)) { account in
AccountCellView(
Expand Down

0 comments on commit 0ca32d8

Please sign in to comment.