Impressia/Vernissage/Widgets/SettingsView/AccountsSection.swift

34 lines
998 B
Swift
Raw Normal View History

2023-01-13 13:37:01 +01:00
//
// https://mczachurski.dev
// Copyright © 2023 Marcin Czachurski and the repository contributors.
// Licensed under the MIT License.
//
import SwiftUI
struct AccountsSection: View {
@State private var accounts: [AccountData] = []
var body: some View {
Section("Accounts") {
ForEach(self.accounts) { account in
2023-01-18 18:41:42 +01:00
UsernameRow(accountId: account.id,
accountAvatar: account.avatar,
2023-01-13 13:37:01 +01:00
accountDisplayName: account.displayName,
2023-01-18 18:41:42 +01:00
accountUsername: account.username)
2023-01-13 13:37:01 +01:00
}
2023-01-23 18:01:27 +01:00
NavigationLink(value: RouteurDestinations.signIn) {
2023-01-13 13:37:01 +01:00
HStack {
Text("New account")
Spacer()
Image(systemName: "person.crop.circle.badge.plus")
}
}
}
.task {
self.accounts = AccountDataHandler.shared.getAccountsData()
}
}
}