diff --git a/Sources/Modifiers/Button.swift b/Sources/Library/Modifiers/Button.swift similarity index 98% rename from Sources/Modifiers/Button.swift rename to Sources/Library/Modifiers/Button.swift index a8aa53e..cf54b5c 100644 --- a/Sources/Modifiers/Button.swift +++ b/Sources/Library/Modifiers/Button.swift @@ -92,7 +92,7 @@ extension View { } .voPrimaryButton(width: 60) Button {} label: { - VOButtonLabel("Lorem Ipsum") + VOButtonLabel("Lorem Ipsum", isLoading: true) } .voSecondaryButton(colorScheme: colorScheme, width: 200) Button {} label: { diff --git a/Sources/Modifiers/ErrorAlert.swift b/Sources/Library/Modifiers/ErrorAlert.swift similarity index 100% rename from Sources/Modifiers/ErrorAlert.swift rename to Sources/Library/Modifiers/ErrorAlert.swift diff --git a/Sources/Library/Modifiers/ErrorSheet.swift b/Sources/Library/Modifiers/ErrorSheet.swift new file mode 100644 index 0000000..e2dbd6f --- /dev/null +++ b/Sources/Library/Modifiers/ErrorSheet.swift @@ -0,0 +1,68 @@ +// Copyright (c) 2024 Anass Bouassaba. +// +// Use of this software is governed by the Business Source License +// included in the file LICENSE in the root of this repository. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the GNU Affero General Public License v3.0 only, included in the file +// AGPL-3.0-only in the root of this repository. + +import SwiftUI + +struct VOErrorSheet: ViewModifier { + @Environment(\.colorScheme) private var colorScheme + private let isPresented: Binding + private let message: String? + + init(isPresented: Binding, message: String?) { + self.isPresented = isPresented + self.message = message + } + + func body(content: Content) -> some View { + content + .sheet(isPresented: isPresented) { + VStack(spacing: VOMetrics.spacing) { + VOErrorMessage(message) + Button { + isPresented.wrappedValue = false + } label: { + VOButtonLabel("Dismiss") + } + .voSecondaryButton(colorScheme: colorScheme) + } + .padding() + .presentationDetents([.fraction(0.25)]) + } + } +} + +extension View { + func voErrorSheet(isPresented: Binding, message: String?) -> some View { + modifier(VOErrorSheet(isPresented: isPresented, message: message)) + } +} + +#Preview { + @Previewable @State var showError = false + @Previewable @State var showLongError = false + + VStack(spacing: VOMetrics.spacing) { + Button("Show Error") { + showError = true + } + Button("Show Long Error") { + showLongError = true + } + } + .voErrorSheet( + isPresented: $showError, + message: "Lorem ipsum dolor sit amet." + ) + .voErrorSheet( + isPresented: $showLongError, + // swiftlint:disable:next line_length + message: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + ) +} diff --git a/Sources/Modifiers/FormHintLabel.swift b/Sources/Library/Modifiers/FormHintLabel.swift similarity index 100% rename from Sources/Modifiers/FormHintLabel.swift rename to Sources/Library/Modifiers/FormHintLabel.swift diff --git a/Sources/Modifiers/FormHintText.swift b/Sources/Library/Modifiers/FormHintText.swift similarity index 100% rename from Sources/Modifiers/FormHintText.swift rename to Sources/Library/Modifiers/FormHintText.swift diff --git a/Sources/Modifiers/Heading.swift b/Sources/Library/Modifiers/Heading.swift similarity index 100% rename from Sources/Modifiers/Heading.swift rename to Sources/Library/Modifiers/Heading.swift diff --git a/Sources/Modifiers/TextField.swift b/Sources/Library/Modifiers/TextField.swift similarity index 100% rename from Sources/Modifiers/TextField.swift rename to Sources/Library/Modifiers/TextField.swift diff --git a/Sources/Library/Modifiers/WarningSheet.swift b/Sources/Library/Modifiers/WarningSheet.swift new file mode 100644 index 0000000..c9870a3 --- /dev/null +++ b/Sources/Library/Modifiers/WarningSheet.swift @@ -0,0 +1,68 @@ +// Copyright (c) 2024 Anass Bouassaba. +// +// Use of this software is governed by the Business Source License +// included in the file LICENSE in the root of this repository. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the GNU Affero General Public License v3.0 only, included in the file +// AGPL-3.0-only in the root of this repository. + +import SwiftUI + +struct VOWarningSheet: ViewModifier { + @Environment(\.colorScheme) private var colorScheme + private let isPresented: Binding + private let message: String? + + init(isPresented: Binding, message: String?) { + self.isPresented = isPresented + self.message = message + } + + func body(content: Content) -> some View { + content + .sheet(isPresented: isPresented) { + VStack(spacing: VOMetrics.spacing) { + VOWarningMessage(message) + Button { + isPresented.wrappedValue = false + } label: { + VOButtonLabel("Dismiss") + } + .voSecondaryButton(colorScheme: colorScheme) + } + .padding() + .presentationDetents([.fraction(0.25)]) + } + } +} + +extension View { + func voWarningSheet(isPresented: Binding, message: String?) -> some View { + modifier(VOWarningSheet(isPresented: isPresented, message: message)) + } +} + +#Preview { + @Previewable @State var showWarning = false + @Previewable @State var showLongWarning = false + + VStack(spacing: VOMetrics.spacing) { + Button("Show Warning") { + showWarning = true + } + Button("Show Long Warning") { + showLongWarning = true + } + } + .voWarningSheet( + isPresented: $showWarning, + message: "Lorem ipsum dolor sit amet." + ) + .voWarningSheet( + isPresented: $showLongWarning, + // swiftlint:disable:next line_length + message: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." + ) +} diff --git a/Sources/Views/Avatar.swift b/Sources/Library/Views/Avatar.swift similarity index 98% rename from Sources/Views/Avatar.swift rename to Sources/Library/Views/Avatar.swift index 4c3e408..26691bd 100644 --- a/Sources/Views/Avatar.swift +++ b/Sources/Library/Views/Avatar.swift @@ -71,7 +71,7 @@ struct VOAvatar: View { } #Preview { - VStack(spacing: VOMetrics.spacing) { + VStack(spacing: VOMetrics.spacing2Xl) { VOAvatar(name: "Bruce Wayne", size: 100) VOAvatar(name: "你好世界!!!", size: 100) VOAvatar(name: "مرحبا بالجميع", size: 100) diff --git a/Sources/Views/ButtonLabel.swift b/Sources/Library/Views/ButtonLabel.swift similarity index 100% rename from Sources/Views/ButtonLabel.swift rename to Sources/Library/Views/ButtonLabel.swift diff --git a/Sources/Views/ColorBadge.swift b/Sources/Library/Views/ColorBadge.swift similarity index 78% rename from Sources/Views/ColorBadge.swift rename to Sources/Library/Views/ColorBadge.swift index 982c215..03ba6ea 100644 --- a/Sources/Views/ColorBadge.swift +++ b/Sources/Library/Views/ColorBadge.swift @@ -10,7 +10,7 @@ import SwiftUI -struct ColorBadge: View { +struct VOColorBadge: View { var text: String var color: Color var style: Style @@ -52,11 +52,11 @@ struct ColorBadge: View { #Preview { VStack { - ColorBadge("Red", color: .red400, style: .fill) - ColorBadge("Purple", color: .purple400, style: .fill) - ColorBadge("Green", color: .green400, style: .fill) - ColorBadge("Red", color: .red400, style: .outline) - ColorBadge("Purple", color: .purple400, style: .outline) - ColorBadge("Green", color: .green400, style: .outline) + VOColorBadge("Red", color: .red400, style: .fill) + VOColorBadge("Purple", color: .purple400, style: .fill) + VOColorBadge("Green", color: .green400, style: .fill) + VOColorBadge("Red", color: .red400, style: .outline) + VOColorBadge("Purple", color: .purple400, style: .outline) + VOColorBadge("Green", color: .green400, style: .outline) } } diff --git a/Sources/Views/SheetIcon.swift b/Sources/Library/Views/ErrorIcon.swift similarity index 50% rename from Sources/Views/SheetIcon.swift rename to Sources/Library/Views/ErrorIcon.swift index 94e1ad3..3e89d0f 100644 --- a/Sources/Views/SheetIcon.swift +++ b/Sources/Library/Views/ErrorIcon.swift @@ -10,29 +10,14 @@ import SwiftUI -struct VOSheetErrorIcon: View { +struct VOErrorIcon: View { var body: some View { - Image(systemName: "xmark.circle.fill") - .resizable() - .aspectRatio(contentMode: .fit) - .frame(width: 30, height: 30) + Image(systemName: "xmark.circle") + .font(.title) .foregroundStyle(Color.red500) } } -struct SheetWarningIcon: View { - var body: some View { - Image(systemName: "exclamationmark.triangle.fill") - .resizable() - .aspectRatio(contentMode: .fit) - .frame(width: 30, height: 30) - .foregroundStyle(Color.yellow300) - } -} - #Preview { - VStack { - VOSheetErrorIcon() - SheetWarningIcon() - } + VOErrorIcon() } diff --git a/Sources/Library/Views/ErrorMessage.swift b/Sources/Library/Views/ErrorMessage.swift new file mode 100644 index 0000000..10d2a48 --- /dev/null +++ b/Sources/Library/Views/ErrorMessage.swift @@ -0,0 +1,43 @@ +// Copyright (c) 2024 Anass Bouassaba. +// +// Use of this software is governed by the Business Source License +// included in the file LICENSE in the root of this repository. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the GNU Affero General Public License v3.0 only, included in the file +// AGPL-3.0-only in the root of this repository. + +import SwiftUI + +struct VOErrorMessage: View { + let message: String? + + init() { + message = nil + } + + init(_ message: String?) { + self.message = message + } + + var body: some View { + VStack(spacing: VOMetrics.spacingXs) { + VOErrorIcon() + if let message { + Text(message) + .foregroundStyle(.secondary) + .lineLimit(1) + } + } + } +} + +#Preview { + VStack(spacing: VOMetrics.spacing2Xl) { + VOErrorMessage("Lorem ipsum dolor sit amet.") + // swiftlint:disable:next line_length + VOErrorMessage("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") + } + .padding() +} diff --git a/Sources/Views/Logo.swift b/Sources/Library/Views/Logo.swift similarity index 100% rename from Sources/Views/Logo.swift rename to Sources/Library/Views/Logo.swift diff --git a/Sources/Views/NumberBadge.swift b/Sources/Library/Views/NumberBadge.swift similarity index 100% rename from Sources/Views/NumberBadge.swift rename to Sources/Library/Views/NumberBadge.swift diff --git a/Sources/Views/PermissionBadge.swift b/Sources/Library/Views/PermissionBadge.swift similarity index 82% rename from Sources/Views/PermissionBadge.swift rename to Sources/Library/Views/PermissionBadge.swift index c36c66f..95e99e0 100644 --- a/Sources/Views/PermissionBadge.swift +++ b/Sources/Library/Views/PermissionBadge.swift @@ -11,7 +11,7 @@ import SwiftUI import VoltaserveCore -struct PermissionBadge: View { +struct VOPermissionBadge: View { var permission: VOPermission.Value init(_ permission: VOPermission.Value) { @@ -19,7 +19,7 @@ struct PermissionBadge: View { } var body: some View { - ColorBadge(text(), color: Constants.background, style: .fill) + VOColorBadge(text(), color: Constants.background, style: .fill) } func text() -> String { @@ -42,8 +42,8 @@ struct PermissionBadge: View { #Preview { VStack { - PermissionBadge(.viewer) - PermissionBadge(.editor) - PermissionBadge(.owner) + VOPermissionBadge(.viewer) + VOPermissionBadge(.editor) + VOPermissionBadge(.owner) } } diff --git a/Sources/Views/SectionHeader.swift b/Sources/Library/Views/SectionHeader.swift similarity index 100% rename from Sources/Views/SectionHeader.swift rename to Sources/Library/Views/SectionHeader.swift diff --git a/Sources/Views/SheetProgressView.swift b/Sources/Library/Views/SheetProgressView.swift similarity index 100% rename from Sources/Views/SheetProgressView.swift rename to Sources/Library/Views/SheetProgressView.swift diff --git a/Sources/Views/StoragePicker.swift b/Sources/Library/Views/StoragePicker.swift similarity index 100% rename from Sources/Views/StoragePicker.swift rename to Sources/Library/Views/StoragePicker.swift diff --git a/Sources/Library/Views/WarningIcon.swift b/Sources/Library/Views/WarningIcon.swift new file mode 100644 index 0000000..d660892 --- /dev/null +++ b/Sources/Library/Views/WarningIcon.swift @@ -0,0 +1,23 @@ +// Copyright (c) 2024 Anass Bouassaba. +// +// Use of this software is governed by the Business Source License +// included in the file LICENSE in the root of this repository. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the GNU Affero General Public License v3.0 only, included in the file +// AGPL-3.0-only in the root of this repository. + +import SwiftUI + +struct VOWarningIcon: View { + var body: some View { + Image(systemName: "exclamationmark.triangle") + .font(.title) + .foregroundStyle(Color.yellow400) + } +} + +#Preview { + VOWarningIcon() +} diff --git a/Sources/Library/Views/WarningMessage.swift b/Sources/Library/Views/WarningMessage.swift new file mode 100644 index 0000000..52fee33 --- /dev/null +++ b/Sources/Library/Views/WarningMessage.swift @@ -0,0 +1,43 @@ +// Copyright (c) 2024 Anass Bouassaba. +// +// Use of this software is governed by the Business Source License +// included in the file LICENSE in the root of this repository. +// +// As of the Change Date specified in that file, in accordance with +// the Business Source License, use of this software will be governed +// by the GNU Affero General Public License v3.0 only, included in the file +// AGPL-3.0-only in the root of this repository. + +import SwiftUI + +struct VOWarningMessage: View { + let message: String? + + init() { + message = nil + } + + init(_ message: String?) { + self.message = message + } + + var body: some View { + VStack(spacing: VOMetrics.spacingXs) { + VOWarningIcon() + if let message { + Text(message) + .foregroundStyle(.secondary) + .lineLimit(1) + } + } + } +} + +#Preview { + VStack(spacing: VOMetrics.spacing2Xl) { + VOWarningMessage("Lorem ipsum dolor sit amet.") + // swiftlint:disable:next line_length + VOWarningMessage("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") + } + .padding() +} diff --git a/Sources/Screens/Account/AccountSettings.swift b/Sources/Screens/Account/AccountSettings.swift index 3af3f84..ff2d3d1 100644 --- a/Sources/Screens/Account/AccountSettings.swift +++ b/Sources/Screens/Account/AccountSettings.swift @@ -116,7 +116,16 @@ struct AccountSettings: View { } .navigationBarTitleDisplayMode(.inline) .navigationTitle("Settings") - .voErrorAlert(isPresented: $showError, title: errorTitle, message: errorMessage) + .voErrorAlert( + isPresented: $showError, + title: errorTitle, + message: errorMessage + ) + .voErrorAlert( + isPresented: $accountStore.showError, + title: accountStore.errorTitle, + message: accountStore.errorMessage + ) .onAppear { accountStore.tokenStore = tokenStore if tokenStore.token != nil { @@ -128,7 +137,6 @@ struct AccountSettings: View { onAppearOrChange() } } - .sync($accountStore.showError, with: $showError) } private func onAppearOrChange() { diff --git a/Sources/Screens/File/FileCopy.swift b/Sources/Screens/File/FileCopy.swift index f7d91f0..e0d479a 100644 --- a/Sources/Screens/File/FileCopy.swift +++ b/Sources/Screens/File/FileCopy.swift @@ -32,7 +32,7 @@ struct FileCopy: View { VOSheetProgressView() Text("Copying \(fileStore.selection.count) item(s).") } else if showError, errorSeverity == .full { - VOSheetErrorIcon() + VOErrorIcon() if let errorMessage { Text(errorMessage) } @@ -44,7 +44,7 @@ struct FileCopy: View { .voSecondaryButton(colorScheme: colorScheme) .padding(.horizontal) } else if showError, errorSeverity == .partial { - SheetWarningIcon() + VOWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileDelete.swift b/Sources/Screens/File/FileDelete.swift index be7c761..f1621c3 100644 --- a/Sources/Screens/File/FileDelete.swift +++ b/Sources/Screens/File/FileDelete.swift @@ -30,7 +30,7 @@ struct FileDelete: View { VOSheetProgressView() Text("Deleting \(fileStore.selection.count) item(s).") } else if showError, errorSeverity == .full { - VOSheetErrorIcon() + VOErrorIcon() if let errorMessage { Text(errorMessage) } @@ -42,7 +42,7 @@ struct FileDelete: View { .voSecondaryButton(colorScheme: colorScheme) .padding(.horizontal) } else if showError, errorSeverity == .partial { - SheetWarningIcon() + VOWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileDownload.swift b/Sources/Screens/File/FileDownload.swift index be1bdaf..362e7ef 100644 --- a/Sources/Screens/File/FileDownload.swift +++ b/Sources/Screens/File/FileDownload.swift @@ -33,7 +33,7 @@ struct FileDownload: View { VOSheetProgressView() Text("Downloading \(fileStore.selectionFiles.count) item(s).") } else if showError, errorSeverity == .full { - VOSheetErrorIcon() + VOErrorIcon() if let errorMessage { Text(errorMessage) } @@ -45,7 +45,7 @@ struct FileDownload: View { .voSecondaryButton(colorScheme: colorScheme) .padding(.horizontal) } else if showError, errorSeverity == .partial { - SheetWarningIcon() + VOWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileInfo.swift b/Sources/Screens/File/FileInfo.swift index a7471f4..9ce40e9 100644 --- a/Sources/Screens/File/FileInfo.swift +++ b/Sources/Screens/File/FileInfo.swift @@ -51,13 +51,13 @@ struct FileInfo: View { HStack { Text("Extension") Spacer() - ColorBadge(fileExtension, color: .gray300, style: .fill) + VOColorBadge(fileExtension, color: .gray300, style: .fill) } } HStack { Text("Permission") Spacer() - PermissionBadge(file.permission) + VOPermissionBadge(file.permission) } } if let image = file.snapshot?.original.image { diff --git a/Sources/Screens/File/FileMove.swift b/Sources/Screens/File/FileMove.swift index 74e1bec..0893357 100644 --- a/Sources/Screens/File/FileMove.swift +++ b/Sources/Screens/File/FileMove.swift @@ -32,7 +32,7 @@ struct FileMove: View { VOSheetProgressView() Text("Moving \(fileStore.selection.count) item(s).") } else if showError, errorSeverity == .full { - VOSheetErrorIcon() + VOErrorIcon() if let errorMessage { Text(errorMessage) } @@ -44,7 +44,7 @@ struct FileMove: View { .voSecondaryButton(colorScheme: colorScheme) .padding(.horizontal) } else if showError, errorSeverity == .partial { - SheetWarningIcon() + VOWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileUpload.swift b/Sources/Screens/File/FileUpload.swift index 09a0a7d..81b6e19 100644 --- a/Sources/Screens/File/FileUpload.swift +++ b/Sources/Screens/File/FileUpload.swift @@ -34,7 +34,7 @@ struct FileUpload: View { VOSheetProgressView() Text("Uploading \(urls.count) item(s).") } else if showError, errorSeverity == .full { - VOSheetErrorIcon() + VOErrorIcon() if let errorMessage { Text(errorMessage) } @@ -46,7 +46,7 @@ struct FileUpload: View { .voSecondaryButton(colorScheme: colorScheme) .padding(.horizontal) } else if showError, errorSeverity == .partial { - SheetWarningIcon() + VOWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/Insights/InsightsEntityRow.swift b/Sources/Screens/Insights/InsightsEntityRow.swift index 06aaa2d..7085aed 100644 --- a/Sources/Screens/Insights/InsightsEntityRow.swift +++ b/Sources/Screens/Insights/InsightsEntityRow.swift @@ -23,7 +23,7 @@ struct InsightsEntityRow: View { Text(entity.text) .lineLimit(1) .truncationMode(.tail) - ColorBadge("\(entity.frequency)", color: .gray300, style: .fill) + VOColorBadge("\(entity.frequency)", color: .gray300, style: .fill) } } } diff --git a/Sources/Screens/Sharing/SharingGroupRow.swift b/Sources/Screens/Sharing/SharingGroupRow.swift index 7f9c7dc..e1c7663 100644 --- a/Sources/Screens/Sharing/SharingGroupRow.swift +++ b/Sources/Screens/Sharing/SharingGroupRow.swift @@ -34,7 +34,7 @@ struct SharingGroupRow: View { .truncationMode(.tail) } Spacer() - PermissionBadge(groupPermission.permission) + VOPermissionBadge(groupPermission.permission) } } } diff --git a/Sources/Screens/Sharing/SharingUserRow.swift b/Sources/Screens/Sharing/SharingUserRow.swift index 14f2fd0..ce792dc 100644 --- a/Sources/Screens/Sharing/SharingUserRow.swift +++ b/Sources/Screens/Sharing/SharingUserRow.swift @@ -40,7 +40,7 @@ struct SharingUserRow: View { .truncationMode(.middle) } Spacer() - PermissionBadge(userPermission.permission) + VOPermissionBadge(userPermission.permission) } } } diff --git a/Sources/Screens/Snapshot/SnapshotFeatures.swift b/Sources/Screens/Snapshot/SnapshotFeatures.swift index 70feffb..fa2afc6 100644 --- a/Sources/Screens/Snapshot/SnapshotFeatures.swift +++ b/Sources/Screens/Snapshot/SnapshotFeatures.swift @@ -21,10 +21,10 @@ struct SnapshotFeatures: View { var body: some View { HStack { if snapshot.entities != nil { - ColorBadge("Insights", color: .gray400, style: .outline) + VOColorBadge("Insights", color: .gray400, style: .outline) } if snapshot.mosaic != nil { - ColorBadge("Mosaic", color: .gray400, style: .outline) + VOColorBadge("Mosaic", color: .gray400, style: .outline) } } } diff --git a/Sources/Screens/Snapshot/SnapshotRow.swift b/Sources/Screens/Snapshot/SnapshotRow.swift index 9db3579..6e4534e 100644 --- a/Sources/Screens/Snapshot/SnapshotRow.swift +++ b/Sources/Screens/Snapshot/SnapshotRow.swift @@ -30,9 +30,9 @@ struct SnapshotRow: View { Text(date.pretty) } HStack { - ColorBadge("v\(snapshot.version)", color: .gray400, style: .outline) + VOColorBadge("v\(snapshot.version)", color: .gray400, style: .outline) if let size = snapshot.original.size { - ColorBadge(size.prettyBytes(), color: .gray400, style: .outline) + VOColorBadge(size.prettyBytes(), color: .gray400, style: .outline) } if snapshot.hasFeatures() { SnapshotFeatures(snapshot) diff --git a/Sources/Screens/Workspace/WorkspaceList.swift b/Sources/Screens/Workspace/WorkspaceList.swift index eed4edc..4486969 100644 --- a/Sources/Screens/Workspace/WorkspaceList.swift +++ b/Sources/Screens/Workspace/WorkspaceList.swift @@ -144,13 +144,13 @@ struct WorkspaceList: View { Button { showAccount.toggle() } label: { - if let user = accountStore.identityUser { + if let identityUser = accountStore.identityUser { VOAvatar( - name: user.fullName, + name: identityUser.fullName, size: 30, url: accountStore.urlForUserPicture( - user.id, - fileExtension: user.picture?.fileExtension + identityUser.id, + fileExtension: identityUser.picture?.fileExtension ) ) } else { diff --git a/Voltaserve.xcodeproj/project.pbxproj b/Voltaserve.xcodeproj/project.pbxproj index 1ac7666..498dc3f 100644 --- a/Voltaserve.xcodeproj/project.pbxproj +++ b/Voltaserve.xcodeproj/project.pbxproj @@ -52,34 +52,6 @@ ); target = 649066DD2C5E35AD00BA3CCD /* Voltaserve */; }; - 644C38DB2C8F3744008E8F0F /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { - isa = PBXFileSystemSynchronizedBuildFileExceptionSet; - membershipExceptions = ( - Button.swift, - ErrorAlert.swift, - FormHintLabel.swift, - FormHintText.swift, - Heading.swift, - TextField.swift, - ); - target = 649066DD2C5E35AD00BA3CCD /* Voltaserve */; - }; - 644C38DC2C8F3744008E8F0F /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { - isa = PBXFileSystemSynchronizedBuildFileExceptionSet; - membershipExceptions = ( - Avatar.swift, - ButtonLabel.swift, - ColorBadge.swift, - Logo.swift, - NumberBadge.swift, - PermissionBadge.swift, - SectionHeader.swift, - SheetIcon.swift, - SheetProgressView.swift, - StoragePicker.swift, - ); - target = 649066DD2C5E35AD00BA3CCD /* Voltaserve */; - }; 64E4CA1B2C92496100395C9D /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( @@ -239,9 +211,8 @@ /* Begin PBXFileSystemSynchronizedRootGroup section */ 644C38B42C8F3744008E8F0F /* Helpers */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Helpers; sourceTree = ""; }; 644C38B72C8F3744008E8F0F /* Infrastructure */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (644C38DA2C8F3744008E8F0F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Infrastructure; sourceTree = ""; }; - 644C38BD2C8F3744008E8F0F /* Modifiers */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (644C38DB2C8F3744008E8F0F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Modifiers; sourceTree = ""; }; - 644C38C42C8F3744008E8F0F /* Views */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (644C38DC2C8F3744008E8F0F /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Views; sourceTree = ""; }; 64DA01D12C98766E0063A4CB /* Design */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Design; sourceTree = ""; }; + 64DA46312CF1A7AA00D57366 /* Library */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = Library; sourceTree = ""; }; 64E4C9B52C92495000395C9D /* Screens */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (64E4CA1B2C92496100395C9D /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = Screens; sourceTree = ""; }; /* End PBXFileSystemSynchronizedRootGroup section */ @@ -285,12 +256,11 @@ 649066E02C5E35AD00BA3CCD /* Sources */ = { isa = PBXGroup; children = ( + 64DA46312CF1A7AA00D57366 /* Library */, 64E4C9B52C92495000395C9D /* Screens */, 64DA01D12C98766E0063A4CB /* Design */, 644C38B42C8F3744008E8F0F /* Helpers */, 644C38B72C8F3744008E8F0F /* Infrastructure */, - 644C38BD2C8F3744008E8F0F /* Modifiers */, - 644C38C42C8F3744008E8F0F /* Views */, 64D0D9132C8103DF00B96180 /* Config.swift */, 649AED222C7FBE0F00DAAA0B /* MainView.swift */, 649066E32C5E35AD00BA3CCD /* ContentView.swift */, @@ -335,6 +305,7 @@ fileSystemSynchronizedGroups = ( 644C38B42C8F3744008E8F0F /* Helpers */, 64DA01D12C98766E0063A4CB /* Design */, + 64DA46312CF1A7AA00D57366 /* Library */, ); name = Voltaserve; packageProductDependencies = ( diff --git a/Voltaserve.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Voltaserve.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index ee34492..fd3e8ad 100644 --- a/Voltaserve.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Voltaserve.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -16,7 +16,7 @@ "location" : "https://github.com/kouprlabs/voltaserve-swift.git", "state" : { "branch" : "main", - "revision" : "b5863ba9e5175424eb18e173ceff56b38a89e2b6" + "revision" : "fb5452f248c1245142674c33fb033cfc045be90f" } } ],