From 51080e30a7f1dab202c0ac81457a32d4f9424ec4 Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Thu, 21 Nov 2024 14:15:45 +0100 Subject: [PATCH 1/9] chore: update to latest VoltaserveCore --- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Voltaserve.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Voltaserve.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index ee34492..fc36c4d 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" : "24377cc5256a973355c222ceba2be10a45cecd7f" } } ], From 5c6a135228a1f8042f11e9be763c800356685538 Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Thu, 21 Nov 2024 14:43:43 +0100 Subject: [PATCH 2/9] wip: remove usage of sync extension --- Sources/Screens/Account/AccountSettings.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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() { From d438d310dae620fc8a6e4561d28bc8087994979e Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Sat, 23 Nov 2024 00:23:20 +0100 Subject: [PATCH 3/9] refactor: mitigate inconsistencies in naming --- Sources/Screens/File/FileCopy.swift | 2 +- Sources/Screens/File/FileDelete.swift | 2 +- Sources/Screens/File/FileDownload.swift | 2 +- Sources/Screens/File/FileInfo.swift | 4 ++-- Sources/Screens/File/FileMove.swift | 2 +- Sources/Screens/File/FileUpload.swift | 2 +- Sources/Screens/Insights/InsightsEntityRow.swift | 2 +- Sources/Screens/Sharing/SharingGroupRow.swift | 2 +- Sources/Screens/Sharing/SharingUserRow.swift | 2 +- Sources/Screens/Snapshot/SnapshotFeatures.swift | 4 ++-- Sources/Screens/Snapshot/SnapshotRow.swift | 4 ++-- Sources/Views/ColorBadge.swift | 14 +++++++------- Sources/Views/PermissionBadge.swift | 10 +++++----- Sources/Views/SheetIcon.swift | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Sources/Screens/File/FileCopy.swift b/Sources/Screens/File/FileCopy.swift index f7d91f0..6403990 100644 --- a/Sources/Screens/File/FileCopy.swift +++ b/Sources/Screens/File/FileCopy.swift @@ -44,7 +44,7 @@ struct FileCopy: View { .voSecondaryButton(colorScheme: colorScheme) .padding(.horizontal) } else if showError, errorSeverity == .partial { - SheetWarningIcon() + VOSheetWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileDelete.swift b/Sources/Screens/File/FileDelete.swift index be7c761..9b9ae8f 100644 --- a/Sources/Screens/File/FileDelete.swift +++ b/Sources/Screens/File/FileDelete.swift @@ -42,7 +42,7 @@ struct FileDelete: View { .voSecondaryButton(colorScheme: colorScheme) .padding(.horizontal) } else if showError, errorSeverity == .partial { - SheetWarningIcon() + VOSheetWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileDownload.swift b/Sources/Screens/File/FileDownload.swift index be1bdaf..26b4fed 100644 --- a/Sources/Screens/File/FileDownload.swift +++ b/Sources/Screens/File/FileDownload.swift @@ -45,7 +45,7 @@ struct FileDownload: View { .voSecondaryButton(colorScheme: colorScheme) .padding(.horizontal) } else if showError, errorSeverity == .partial { - SheetWarningIcon() + VOSheetWarningIcon() 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..c7018d8 100644 --- a/Sources/Screens/File/FileMove.swift +++ b/Sources/Screens/File/FileMove.swift @@ -44,7 +44,7 @@ struct FileMove: View { .voSecondaryButton(colorScheme: colorScheme) .padding(.horizontal) } else if showError, errorSeverity == .partial { - SheetWarningIcon() + VOSheetWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileUpload.swift b/Sources/Screens/File/FileUpload.swift index 09a0a7d..bcb2b3f 100644 --- a/Sources/Screens/File/FileUpload.swift +++ b/Sources/Screens/File/FileUpload.swift @@ -46,7 +46,7 @@ struct FileUpload: View { .voSecondaryButton(colorScheme: colorScheme) .padding(.horizontal) } else if showError, errorSeverity == .partial { - SheetWarningIcon() + VOSheetWarningIcon() 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/Views/ColorBadge.swift b/Sources/Views/ColorBadge.swift index 982c215..03ba6ea 100644 --- a/Sources/Views/ColorBadge.swift +++ b/Sources/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/PermissionBadge.swift b/Sources/Views/PermissionBadge.swift index c36c66f..95e99e0 100644 --- a/Sources/Views/PermissionBadge.swift +++ b/Sources/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/SheetIcon.swift b/Sources/Views/SheetIcon.swift index 94e1ad3..14bd59f 100644 --- a/Sources/Views/SheetIcon.swift +++ b/Sources/Views/SheetIcon.swift @@ -20,7 +20,7 @@ struct VOSheetErrorIcon: View { } } -struct SheetWarningIcon: View { +struct VOSheetWarningIcon: View { var body: some View { Image(systemName: "exclamationmark.triangle.fill") .resizable() @@ -33,6 +33,6 @@ struct SheetWarningIcon: View { #Preview { VStack { VOSheetErrorIcon() - SheetWarningIcon() + VOSheetWarningIcon() } } From f98ed6b3ae9ae75805a84692977474fdaa0aee9e Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Sat, 23 Nov 2024 04:52:07 +0100 Subject: [PATCH 4/9] feat: views for error and warning --- .../{SheetIcon.swift => ErrorIcon.swift} | 22 ++++------ Sources/Views/ErrorMessage.swift | 43 +++++++++++++++++++ Sources/Views/WarningIcon.swift | 34 +++++++++++++++ Sources/Views/WarningMessage.swift | 43 +++++++++++++++++++ 4 files changed, 129 insertions(+), 13 deletions(-) rename Sources/Views/{SheetIcon.swift => ErrorIcon.swift} (54%) create mode 100644 Sources/Views/ErrorMessage.swift create mode 100644 Sources/Views/WarningIcon.swift create mode 100644 Sources/Views/WarningMessage.swift diff --git a/Sources/Views/SheetIcon.swift b/Sources/Views/ErrorIcon.swift similarity index 54% rename from Sources/Views/SheetIcon.swift rename to Sources/Views/ErrorIcon.swift index 14bd59f..a03ce3c 100644 --- a/Sources/Views/SheetIcon.swift +++ b/Sources/Views/ErrorIcon.swift @@ -10,29 +10,25 @@ 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(.largeTitle) .foregroundStyle(Color.red500) } } -struct VOSheetWarningIcon: View { +struct VOWarningIcon: View { var body: some View { - Image(systemName: "exclamationmark.triangle.fill") - .resizable() - .aspectRatio(contentMode: .fit) - .frame(width: 30, height: 30) - .foregroundStyle(Color.yellow300) + Image(systemName: "exclamationmark.triangle") + .font(.largeTitle) + .foregroundStyle(Color.yellow400) } } #Preview { VStack { - VOSheetErrorIcon() - VOSheetWarningIcon() + VOErrorIcon() + VOWarningIcon() } } diff --git a/Sources/Views/ErrorMessage.swift b/Sources/Views/ErrorMessage.swift new file mode 100644 index 0000000..4c122dc --- /dev/null +++ b/Sources/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(Color.red500) + .multilineTextAlignment(.center) + } + } + } +} + +#Preview { + VStack(spacing: 100) { + VOErrorMessage() + VOErrorMessage("Lorem ipsum dolor sit amet") + 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/WarningIcon.swift b/Sources/Views/WarningIcon.swift new file mode 100644 index 0000000..a03ce3c --- /dev/null +++ b/Sources/Views/WarningIcon.swift @@ -0,0 +1,34 @@ +// 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 VOErrorIcon: View { + var body: some View { + Image(systemName: "xmark.circle") + .font(.largeTitle) + .foregroundStyle(Color.red500) + } +} + +struct VOWarningIcon: View { + var body: some View { + Image(systemName: "exclamationmark.triangle") + .font(.largeTitle) + .foregroundStyle(Color.yellow400) + } +} + +#Preview { + VStack { + VOErrorIcon() + VOWarningIcon() + } +} diff --git a/Sources/Views/WarningMessage.swift b/Sources/Views/WarningMessage.swift new file mode 100644 index 0000000..86803d3 --- /dev/null +++ b/Sources/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(Color.yellow400) + .multilineTextAlignment(.center) + } + } + } +} + +#Preview { + VStack(spacing: 100) { + VOWarningMessage() + VOWarningMessage(message: "Lorem ipsum dolor sit amet") + VOWarningMessage(message: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") + } + .padding() +} From 3641cb158ff33b48843283a5cb94de81c82ef73b Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Sat, 23 Nov 2024 04:53:26 +0100 Subject: [PATCH 5/9] refactor: common views --- Sources/Screens/File/FileCopy.swift | 4 ++-- Sources/Screens/File/FileDelete.swift | 4 ++-- Sources/Screens/File/FileDownload.swift | 4 ++-- Sources/Screens/File/FileMove.swift | 4 ++-- Sources/Screens/File/FileUpload.swift | 4 ++-- Sources/Views/Avatar.swift | 2 +- Sources/Views/ErrorIcon.swift | 13 +------------ Sources/Views/ErrorMessage.swift | 7 +++---- Sources/Views/WarningIcon.swift | 13 +------------ Sources/Views/WarningMessage.swift | 11 +++++------ Voltaserve.xcodeproj/project.pbxproj | 5 ++++- 11 files changed, 25 insertions(+), 46 deletions(-) diff --git a/Sources/Screens/File/FileCopy.swift b/Sources/Screens/File/FileCopy.swift index 6403990..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 { - VOSheetWarningIcon() + VOWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileDelete.swift b/Sources/Screens/File/FileDelete.swift index 9b9ae8f..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 { - VOSheetWarningIcon() + VOWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileDownload.swift b/Sources/Screens/File/FileDownload.swift index 26b4fed..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 { - VOSheetWarningIcon() + VOWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileMove.swift b/Sources/Screens/File/FileMove.swift index c7018d8..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 { - VOSheetWarningIcon() + VOWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Screens/File/FileUpload.swift b/Sources/Screens/File/FileUpload.swift index bcb2b3f..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 { - VOSheetWarningIcon() + VOWarningIcon() if let errorMessage { Text(errorMessage) } diff --git a/Sources/Views/Avatar.swift b/Sources/Views/Avatar.swift index 4c3e408..26691bd 100644 --- a/Sources/Views/Avatar.swift +++ b/Sources/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/ErrorIcon.swift b/Sources/Views/ErrorIcon.swift index a03ce3c..ed88a28 100644 --- a/Sources/Views/ErrorIcon.swift +++ b/Sources/Views/ErrorIcon.swift @@ -18,17 +18,6 @@ struct VOErrorIcon: View { } } -struct VOWarningIcon: View { - var body: some View { - Image(systemName: "exclamationmark.triangle") - .font(.largeTitle) - .foregroundStyle(Color.yellow400) - } -} - #Preview { - VStack { - VOErrorIcon() - VOWarningIcon() - } + VOErrorIcon() } diff --git a/Sources/Views/ErrorMessage.swift b/Sources/Views/ErrorMessage.swift index 4c122dc..e6a1573 100644 --- a/Sources/Views/ErrorMessage.swift +++ b/Sources/Views/ErrorMessage.swift @@ -26,7 +26,7 @@ struct VOErrorMessage: View { VOErrorIcon() if let message { Text(message) - .foregroundStyle(Color.red500) + .foregroundStyle(.secondary) .multilineTextAlignment(.center) } } @@ -34,9 +34,8 @@ struct VOErrorMessage: View { } #Preview { - VStack(spacing: 100) { - VOErrorMessage() - VOErrorMessage("Lorem ipsum dolor sit amet") + VStack(spacing: VOMetrics.spacing2Xl) { + VOErrorMessage("Lorem ipsum dolor sit amet.") 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/WarningIcon.swift b/Sources/Views/WarningIcon.swift index a03ce3c..ee9effd 100644 --- a/Sources/Views/WarningIcon.swift +++ b/Sources/Views/WarningIcon.swift @@ -10,14 +10,6 @@ import SwiftUI -struct VOErrorIcon: View { - var body: some View { - Image(systemName: "xmark.circle") - .font(.largeTitle) - .foregroundStyle(Color.red500) - } -} - struct VOWarningIcon: View { var body: some View { Image(systemName: "exclamationmark.triangle") @@ -27,8 +19,5 @@ struct VOWarningIcon: View { } #Preview { - VStack { - VOErrorIcon() - VOWarningIcon() - } + VOWarningIcon() } diff --git a/Sources/Views/WarningMessage.swift b/Sources/Views/WarningMessage.swift index 86803d3..3114776 100644 --- a/Sources/Views/WarningMessage.swift +++ b/Sources/Views/WarningMessage.swift @@ -17,7 +17,7 @@ struct VOWarningMessage: View { message = nil } - init(message: String?) { + init(_ message: String?) { self.message = message } @@ -26,7 +26,7 @@ struct VOWarningMessage: View { VOWarningIcon() if let message { Text(message) - .foregroundStyle(Color.yellow400) + .foregroundStyle(.secondary) .multilineTextAlignment(.center) } } @@ -34,10 +34,9 @@ struct VOWarningMessage: View { } #Preview { - VStack(spacing: 100) { - VOWarningMessage() - VOWarningMessage(message: "Lorem ipsum dolor sit amet") - VOWarningMessage(message: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") + VStack(spacing: VOMetrics.spacing2Xl) { + VOWarningMessage("Lorem ipsum dolor sit amet.") + VOWarningMessage("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.") } .padding() } diff --git a/Voltaserve.xcodeproj/project.pbxproj b/Voltaserve.xcodeproj/project.pbxproj index 1ac7666..1cc3066 100644 --- a/Voltaserve.xcodeproj/project.pbxproj +++ b/Voltaserve.xcodeproj/project.pbxproj @@ -70,13 +70,16 @@ Avatar.swift, ButtonLabel.swift, ColorBadge.swift, + ErrorIcon.swift, + ErrorMessage.swift, Logo.swift, NumberBadge.swift, PermissionBadge.swift, SectionHeader.swift, - SheetIcon.swift, SheetProgressView.swift, StoragePicker.swift, + WarningIcon.swift, + WarningMessage.swift, ); target = 649066DD2C5E35AD00BA3CCD /* Voltaserve */; }; From 760053fe0cadeb49e3f9d28ccb6e61c17d6c2f2d Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Sat, 23 Nov 2024 07:59:26 +0100 Subject: [PATCH 6/9] refactor: move common views and modifiers to library folder --- Sources/{ => Library}/Modifiers/Button.swift | 2 +- .../{ => Library}/Modifiers/ErrorAlert.swift | 0 Sources/Library/Modifiers/ErrorSheet.swift | 68 +++++++++++++++++++ .../Modifiers/FormHintLabel.swift | 0 .../Modifiers/FormHintText.swift | 0 Sources/{ => Library}/Modifiers/Heading.swift | 0 .../{ => Library}/Modifiers/TextField.swift | 0 Sources/Library/Modifiers/WarningSheet.swift | 68 +++++++++++++++++++ Sources/{ => Library}/Views/Avatar.swift | 0 Sources/{ => Library}/Views/ButtonLabel.swift | 0 Sources/{ => Library}/Views/ColorBadge.swift | 0 Sources/{ => Library}/Views/ErrorIcon.swift | 0 .../{ => Library}/Views/ErrorMessage.swift | 11 +-- Sources/{ => Library}/Views/Logo.swift | 0 Sources/{ => Library}/Views/NumberBadge.swift | 0 .../{ => Library}/Views/PermissionBadge.swift | 0 .../{ => Library}/Views/SectionHeader.swift | 0 .../Views/SheetProgressView.swift | 0 .../{ => Library}/Views/StoragePicker.swift | 0 Sources/{ => Library}/Views/WarningIcon.swift | 0 .../{ => Library}/Views/WarningMessage.swift | 11 +-- Voltaserve.xcodeproj/project.pbxproj | 38 +---------- 22 files changed, 152 insertions(+), 46 deletions(-) rename Sources/{ => Library}/Modifiers/Button.swift (98%) rename Sources/{ => Library}/Modifiers/ErrorAlert.swift (100%) create mode 100644 Sources/Library/Modifiers/ErrorSheet.swift rename Sources/{ => Library}/Modifiers/FormHintLabel.swift (100%) rename Sources/{ => Library}/Modifiers/FormHintText.swift (100%) rename Sources/{ => Library}/Modifiers/Heading.swift (100%) rename Sources/{ => Library}/Modifiers/TextField.swift (100%) create mode 100644 Sources/Library/Modifiers/WarningSheet.swift rename Sources/{ => Library}/Views/Avatar.swift (100%) rename Sources/{ => Library}/Views/ButtonLabel.swift (100%) rename Sources/{ => Library}/Views/ColorBadge.swift (100%) rename Sources/{ => Library}/Views/ErrorIcon.swift (100%) rename Sources/{ => Library}/Views/ErrorMessage.swift (92%) rename Sources/{ => Library}/Views/Logo.swift (100%) rename Sources/{ => Library}/Views/NumberBadge.swift (100%) rename Sources/{ => Library}/Views/PermissionBadge.swift (100%) rename Sources/{ => Library}/Views/SectionHeader.swift (100%) rename Sources/{ => Library}/Views/SheetProgressView.swift (100%) rename Sources/{ => Library}/Views/StoragePicker.swift (100%) rename Sources/{ => Library}/Views/WarningIcon.swift (100%) rename Sources/{ => Library}/Views/WarningMessage.swift (92%) 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 100% rename from Sources/Views/Avatar.swift rename to Sources/Library/Views/Avatar.swift 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 100% rename from Sources/Views/ColorBadge.swift rename to Sources/Library/Views/ColorBadge.swift diff --git a/Sources/Views/ErrorIcon.swift b/Sources/Library/Views/ErrorIcon.swift similarity index 100% rename from Sources/Views/ErrorIcon.swift rename to Sources/Library/Views/ErrorIcon.swift diff --git a/Sources/Views/ErrorMessage.swift b/Sources/Library/Views/ErrorMessage.swift similarity index 92% rename from Sources/Views/ErrorMessage.swift rename to Sources/Library/Views/ErrorMessage.swift index e6a1573..10d2a48 100644 --- a/Sources/Views/ErrorMessage.swift +++ b/Sources/Library/Views/ErrorMessage.swift @@ -12,22 +12,22 @@ import SwiftUI struct VOErrorMessage: View { let message: String? - - init () { + + 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) - .multilineTextAlignment(.center) + .lineLimit(1) } } } @@ -36,6 +36,7 @@ struct VOErrorMessage: View { #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 100% rename from Sources/Views/PermissionBadge.swift rename to Sources/Library/Views/PermissionBadge.swift 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/Views/WarningIcon.swift b/Sources/Library/Views/WarningIcon.swift similarity index 100% rename from Sources/Views/WarningIcon.swift rename to Sources/Library/Views/WarningIcon.swift diff --git a/Sources/Views/WarningMessage.swift b/Sources/Library/Views/WarningMessage.swift similarity index 92% rename from Sources/Views/WarningMessage.swift rename to Sources/Library/Views/WarningMessage.swift index 3114776..52fee33 100644 --- a/Sources/Views/WarningMessage.swift +++ b/Sources/Library/Views/WarningMessage.swift @@ -12,22 +12,22 @@ import SwiftUI struct VOWarningMessage: View { let message: String? - - init () { + + 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) - .multilineTextAlignment(.center) + .lineLimit(1) } } } @@ -36,6 +36,7 @@ struct VOWarningMessage: View { #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/Voltaserve.xcodeproj/project.pbxproj b/Voltaserve.xcodeproj/project.pbxproj index 1cc3066..498dc3f 100644 --- a/Voltaserve.xcodeproj/project.pbxproj +++ b/Voltaserve.xcodeproj/project.pbxproj @@ -52,37 +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, - ErrorIcon.swift, - ErrorMessage.swift, - Logo.swift, - NumberBadge.swift, - PermissionBadge.swift, - SectionHeader.swift, - SheetProgressView.swift, - StoragePicker.swift, - WarningIcon.swift, - WarningMessage.swift, - ); - target = 649066DD2C5E35AD00BA3CCD /* Voltaserve */; - }; 64E4CA1B2C92496100395C9D /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { isa = PBXFileSystemSynchronizedBuildFileExceptionSet; membershipExceptions = ( @@ -242,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 */ @@ -288,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 */, @@ -338,6 +305,7 @@ fileSystemSynchronizedGroups = ( 644C38B42C8F3744008E8F0F /* Helpers */, 64DA01D12C98766E0063A4CB /* Design */, + 64DA46312CF1A7AA00D57366 /* Library */, ); name = Voltaserve; packageProductDependencies = ( From b5b868b71b2da0722fd13f77b2bdd3fe4304bf36 Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Sat, 23 Nov 2024 08:00:05 +0100 Subject: [PATCH 7/9] refactor: consistent naming --- Sources/Screens/Workspace/WorkspaceList.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 { From cbddcec862cabb7af24b4ff197bba49d985d97a1 Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Sat, 23 Nov 2024 10:09:24 +0100 Subject: [PATCH 8/9] refactor: reduce font size of error and warning icons --- Sources/Library/Views/ErrorIcon.swift | 2 +- Sources/Library/Views/WarningIcon.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Library/Views/ErrorIcon.swift b/Sources/Library/Views/ErrorIcon.swift index ed88a28..3e89d0f 100644 --- a/Sources/Library/Views/ErrorIcon.swift +++ b/Sources/Library/Views/ErrorIcon.swift @@ -13,7 +13,7 @@ import SwiftUI struct VOErrorIcon: View { var body: some View { Image(systemName: "xmark.circle") - .font(.largeTitle) + .font(.title) .foregroundStyle(Color.red500) } } diff --git a/Sources/Library/Views/WarningIcon.swift b/Sources/Library/Views/WarningIcon.swift index ee9effd..d660892 100644 --- a/Sources/Library/Views/WarningIcon.swift +++ b/Sources/Library/Views/WarningIcon.swift @@ -13,7 +13,7 @@ import SwiftUI struct VOWarningIcon: View { var body: some View { Image(systemName: "exclamationmark.triangle") - .font(.largeTitle) + .font(.title) .foregroundStyle(Color.yellow400) } } From 500319b342ae244d4bdb5122e37402e892333cb4 Mon Sep 17 00:00:00 2001 From: Anass Bouassaba Date: Sat, 23 Nov 2024 10:10:14 +0100 Subject: [PATCH 9/9] fix: update VoltaserveCore revision --- .../project.xcworkspace/xcshareddata/swiftpm/Package.resolved | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Voltaserve.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Voltaserve.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index fc36c4d..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" : "24377cc5256a973355c222ceba2be10a45cecd7f" + "revision" : "fb5452f248c1245142674c33fb033cfc045be90f" } } ],