Compare commits
2 Commits
cb34bf96a2
...
910f68f750
Author | SHA1 | Date |
---|---|---|
Marcin Czachurski | 910f68f750 | |
Marcin Czachurski | 16bd7e69c1 |
|
@ -26,7 +26,6 @@
|
|||
F84625F229FE2B6B002D3AF4 /* QRCodeWidgetEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = F84625F129FE2B6B002D3AF4 /* QRCodeWidgetEntry.swift */; };
|
||||
F84625F429FE2BF9002D3AF4 /* QRCodeProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F84625F329FE2BF9002D3AF4 /* QRCodeProvider.swift */; };
|
||||
F84625F829FE2C2F002D3AF4 /* AccountFetcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = F84625F729FE2C2F002D3AF4 /* AccountFetcher.swift */; };
|
||||
F84625FB29FE393B002D3AF4 /* QRCode in Frameworks */ = {isa = PBXBuildFile; productRef = F84625FA29FE393B002D3AF4 /* QRCode */; };
|
||||
F858906B29E1CC7A00D4BDED /* UIApplication+Window.swift in Sources */ = {isa = PBXBuildFile; fileRef = F858906A29E1CC7A00D4BDED /* UIApplication+Window.swift */; };
|
||||
F85D0C652ABA08F9002B3577 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F85D0C642ABA08F9002B3577 /* Assets.xcassets */; };
|
||||
F85D4971296402DC00751DF7 /* AuthorizationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85D4970296402DC00751DF7 /* AuthorizationService.swift */; };
|
||||
|
@ -162,6 +161,7 @@
|
|||
F8DE749F2AE4F7B500ACD188 /* NotificationsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8DE749E2AE4F7B500ACD188 /* NotificationsService.swift */; };
|
||||
F8DF38E429DD68820047F1AA /* ViewOffsetKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8DF38E329DD68820047F1AA /* ViewOffsetKey.swift */; };
|
||||
F8DF38E629DDB98A0047F1AA /* SocialsSectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8DF38E529DDB98A0047F1AA /* SocialsSectionView.swift */; };
|
||||
F8E023642B3C1EBD004F7E18 /* View+If.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E023632B3C1EBD004F7E18 /* View+If.swift */; };
|
||||
F8E36E462AB8745300769C55 /* Sizable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E36E452AB8745300769C55 /* Sizable.swift */; };
|
||||
F8E36E482AB874A500769C55 /* StatusModel+Sizeable.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E36E472AB874A500769C55 /* StatusModel+Sizeable.swift */; };
|
||||
F8E6D03329CDD52500416CCA /* EditProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6D03229CDD52500416CCA /* EditProfileView.swift */; };
|
||||
|
@ -345,6 +345,7 @@
|
|||
F8DE749E2AE4F7B500ACD188 /* NotificationsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationsService.swift; sourceTree = "<group>"; };
|
||||
F8DF38E329DD68820047F1AA /* ViewOffsetKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewOffsetKey.swift; sourceTree = "<group>"; };
|
||||
F8DF38E529DDB98A0047F1AA /* SocialsSectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocialsSectionView.swift; sourceTree = "<group>"; };
|
||||
F8E023632B3C1EBD004F7E18 /* View+If.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+If.swift"; sourceTree = "<group>"; };
|
||||
F8E36E452AB8745300769C55 /* Sizable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sizable.swift; sourceTree = "<group>"; };
|
||||
F8E36E472AB874A500769C55 /* StatusModel+Sizeable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "StatusModel+Sizeable.swift"; sourceTree = "<group>"; };
|
||||
F8E6D03229CDD52500416CCA /* EditProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditProfileView.swift; sourceTree = "<group>"; };
|
||||
|
@ -365,7 +366,6 @@
|
|||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F84625FB29FE393B002D3AF4 /* QRCode in Frameworks */,
|
||||
F864F76129BB91B400B13921 /* SwiftUI.framework in Frameworks */,
|
||||
F864F77A29BB94A800B13921 /* PixelfedKit in Frameworks */,
|
||||
F864F75F29BB91B400B13921 /* WidgetKit.framework in Frameworks */,
|
||||
|
@ -841,6 +841,7 @@
|
|||
F815F60B29E49CF20044566B /* Avatar.swift */,
|
||||
F8F6E45029BCE9190004795E /* UIImage+Resize.swift */,
|
||||
F8FAA0AC2AB0BCB400FD78BD /* View+ContainerBackground.swift */,
|
||||
F8E023632B3C1EBD004F7E18 /* View+If.swift */,
|
||||
);
|
||||
path = Extensions;
|
||||
sourceTree = "<group>";
|
||||
|
@ -864,7 +865,6 @@
|
|||
packageProductDependencies = (
|
||||
F864F77929BB94A800B13921 /* PixelfedKit */,
|
||||
F88BC52E29E04C5F00CE6141 /* EnvironmentKit */,
|
||||
F84625FA29FE393B002D3AF4 /* QRCode */,
|
||||
);
|
||||
productName = VernissageWidgetExtension;
|
||||
productReference = F864F75D29BB91B400B13921 /* VernissageWidgetExtension.appex */;
|
||||
|
@ -964,7 +964,6 @@
|
|||
F8210DD32966BB7E001D9973 /* XCRemoteSwiftPackageReference "Nuke" */,
|
||||
F88E4D4B297EA4290057491A /* XCRemoteSwiftPackageReference "EmojiText" */,
|
||||
F89B5CBE29D019B600549F2F /* XCRemoteSwiftPackageReference "HTMLString" */,
|
||||
F84625F929FE393B002D3AF4 /* XCRemoteSwiftPackageReference "QRCode" */,
|
||||
F8A1920E2ABB322E00C2599A /* XCRemoteSwiftPackageReference "Semaphore" */,
|
||||
);
|
||||
productRefGroup = F88C2469295C37B80006098B /* Products */;
|
||||
|
@ -1031,6 +1030,7 @@
|
|||
F864F76429BB91B400B13921 /* VernissageWidgetBundle.swift in Sources */,
|
||||
F8E7ADFF2AD44CEB0038FFFD /* AccountRelationship.swift in Sources */,
|
||||
F8D8E0CC2ACC237000AA1374 /* ViewedStatus.swift in Sources */,
|
||||
F8E023642B3C1EBD004F7E18 /* View+If.swift in Sources */,
|
||||
F864F7A629BBA01D00B13921 /* CoreDataError.swift in Sources */,
|
||||
F8FAA0AD2AB0BCB400FD78BD /* View+ContainerBackground.swift in Sources */,
|
||||
F8705A7B29FF872F00DA818A /* QRCodeGenerator.swift in Sources */,
|
||||
|
@ -1210,7 +1210,7 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.0.4;
|
||||
MARKETING_VERSION = 2.0.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage.widget;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -1244,7 +1244,7 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.0.4;
|
||||
MARKETING_VERSION = 2.0.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage.widget;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -1277,7 +1277,7 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.0.4;
|
||||
MARKETING_VERSION = 2.0.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage.share;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -1309,7 +1309,7 @@
|
|||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.0.4;
|
||||
MARKETING_VERSION = 2.0.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage.share;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
|
@ -1475,7 +1475,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.0.4;
|
||||
MARKETING_VERSION = 2.0.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
|
@ -1518,7 +1518,7 @@
|
|||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 2.0.4;
|
||||
MARKETING_VERSION = 2.0.5;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = dev.mczachurski.vernissage;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
|
@ -1580,14 +1580,6 @@
|
|||
minimumVersion = 12.0.0;
|
||||
};
|
||||
};
|
||||
F84625F929FE393B002D3AF4 /* XCRemoteSwiftPackageReference "QRCode" */ = {
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/dmrschmidt/QRCode";
|
||||
requirement = {
|
||||
kind = upToNextMajorVersion;
|
||||
minimumVersion = 1.0.0;
|
||||
};
|
||||
};
|
||||
F88E4D4B297EA4290057491A /* XCRemoteSwiftPackageReference "EmojiText" */ = {
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/divadretlaw/EmojiText";
|
||||
|
@ -1630,11 +1622,6 @@
|
|||
package = F8210DD32966BB7E001D9973 /* XCRemoteSwiftPackageReference "Nuke" */;
|
||||
productName = NukeUI;
|
||||
};
|
||||
F84625FA29FE393B002D3AF4 /* QRCode */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = F84625F929FE393B002D3AF4 /* XCRemoteSwiftPackageReference "QRCode" */;
|
||||
productName = QRCode;
|
||||
};
|
||||
F864F77929BB94A800B13921 /* PixelfedKit */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
productName = PixelfedKit;
|
||||
|
|
|
@ -90,15 +90,6 @@
|
|||
"version" : "2.2.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "qrcode",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/dmrschmidt/QRCode",
|
||||
"state" : {
|
||||
"revision" : "a23c2d2b77483c5ce20ffaf4e68fef2d1a0bbca9",
|
||||
"version" : "1.1.0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "semaphore",
|
||||
"kind" : "remoteSourceControl",
|
||||
|
|
|
@ -7,16 +7,6 @@
|
|||
import SwiftUI
|
||||
|
||||
extension View {
|
||||
// func widgetBackground(backgroundView: some View) -> some View {
|
||||
// if #available(iOSApplicationExtension 17.0, *) {
|
||||
// return containerBackground(for: .widget) {
|
||||
// backgroundView
|
||||
// }
|
||||
// } else {
|
||||
// return background(backgroundView)
|
||||
// }
|
||||
// }
|
||||
|
||||
func widgetBackground<V>(@ViewBuilder content: @escaping () -> V) -> some View where V: View {
|
||||
if #available(iOSApplicationExtension 17.0, *) {
|
||||
return containerBackground(for: .widget) {
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// https://mczachurski.dev
|
||||
// Copyright © 2023 Marcin Czachurski and the repository contributors.
|
||||
// Licensed under the Apache License 2.0.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
public extension View {
|
||||
@ViewBuilder
|
||||
func `if`<Content: View>(_ conditional: Bool, content: (Self) -> Content) -> some View {
|
||||
if conditional {
|
||||
content(self)
|
||||
} else {
|
||||
self
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,19 +6,24 @@
|
|||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
import QRCode
|
||||
import CoreImage.CIFilterBuiltins
|
||||
|
||||
public class QRCodeGenerator {
|
||||
struct QRCodeGenerator {
|
||||
public static let shared = QRCodeGenerator()
|
||||
private init() { }
|
||||
|
||||
func generateQRCode(from string: String, scheme: ColorScheme) -> UIImage? {
|
||||
let qrCode = QRCode(string: string,
|
||||
color: scheme == .light ? Color.black.toUIColor() : Color.white.toUIColor(),
|
||||
backgroundColor: scheme == .light ? Color.white.toUIColor() : Color.black.toUIColor(),
|
||||
size: CGSize(width: 150, height: 150),
|
||||
scale: 4.0,
|
||||
inputCorrection: .medium)
|
||||
return try? qrCode?.image()
|
||||
let context = CIContext()
|
||||
|
||||
func generateQRCode(from text: String) -> UIImage? {
|
||||
let filter = CIFilter.qrCodeGenerator()
|
||||
filter.message = Data(text.utf8)
|
||||
|
||||
if let outputImage = filter.outputImage {
|
||||
if let cgimg = context.createCGImage(outputImage, from: outputImage.extent) {
|
||||
return UIImage(cgImage: cgimg)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,18 +13,16 @@ struct QRCodeLargeWidgetView: View {
|
|||
|
||||
var entry: QRCodeProvider.Entry
|
||||
|
||||
private let qrCodeLightImage: UIImage?
|
||||
private let qrCodeDarkImage: UIImage?
|
||||
private let qrCodeImage: UIImage?
|
||||
|
||||
init(entry: QRCodeProvider.Entry) {
|
||||
self.entry = entry
|
||||
|
||||
if let profileUrl = entry.profileUrl {
|
||||
self.qrCodeLightImage = QRCodeGenerator.shared.generateQRCode(from: profileUrl.absoluteString, scheme: .light)
|
||||
self.qrCodeDarkImage = QRCodeGenerator.shared.generateQRCode(from: profileUrl.absoluteString, scheme: .dark)
|
||||
self.qrCodeImage = QRCodeGenerator.shared.generateQRCode(from: profileUrl.absoluteString)
|
||||
|
||||
} else {
|
||||
self.qrCodeLightImage = QRCodeGenerator.shared.generateQRCode(from: "https://pixelfed.org", scheme: .light)
|
||||
self.qrCodeDarkImage = QRCodeGenerator.shared.generateQRCode(from: "https://pixelfed.org", scheme: .dark)
|
||||
self.qrCodeImage = QRCodeGenerator.shared.generateQRCode(from: "https://pixelfed.org")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,10 +35,6 @@ struct QRCodeLargeWidgetView: View {
|
|||
}
|
||||
}
|
||||
|
||||
var qrCodeImage: UIImage? {
|
||||
colorScheme == .dark ? qrCodeDarkImage : qrCodeLightImage
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func getWidgetBody(uiAvatar: Image, uiQRCode: Image) -> some View {
|
||||
VStack(spacing: 0) {
|
||||
|
@ -60,7 +54,11 @@ struct QRCodeLargeWidgetView: View {
|
|||
|
||||
uiQRCode
|
||||
.resizable()
|
||||
.interpolation(.none)
|
||||
.widgetURL(URL(string: "\(AppConstants.accountUri)/\(entry.accountId)"))
|
||||
.if(colorScheme == .dark) {
|
||||
$0.padding(8)
|
||||
}
|
||||
|
||||
if let profileUrl = entry.profileUrl {
|
||||
HStack {
|
||||
|
|
|
@ -13,18 +13,15 @@ struct QRCodeMediumWidgetView: View {
|
|||
|
||||
var entry: QRCodeProvider.Entry
|
||||
|
||||
private let qrCodeLightImage: UIImage?
|
||||
private let qrCodeDarkImage: UIImage?
|
||||
private let qrCodeImage: UIImage?
|
||||
|
||||
init(entry: QRCodeProvider.Entry) {
|
||||
self.entry = entry
|
||||
|
||||
if let profileUrl = entry.profileUrl {
|
||||
self.qrCodeLightImage = QRCodeGenerator.shared.generateQRCode(from: profileUrl.absoluteString, scheme: .light)
|
||||
self.qrCodeDarkImage = QRCodeGenerator.shared.generateQRCode(from: profileUrl.absoluteString, scheme: .dark)
|
||||
self.qrCodeImage = QRCodeGenerator.shared.generateQRCode(from: profileUrl.absoluteString)
|
||||
} else {
|
||||
self.qrCodeLightImage = QRCodeGenerator.shared.generateQRCode(from: "https://pixelfed.org", scheme: .light)
|
||||
self.qrCodeDarkImage = QRCodeGenerator.shared.generateQRCode(from: "https://pixelfed.org", scheme: .dark)
|
||||
self.qrCodeImage = QRCodeGenerator.shared.generateQRCode(from: "https://pixelfed.org")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,18 +34,18 @@ struct QRCodeMediumWidgetView: View {
|
|||
}
|
||||
}
|
||||
|
||||
var qrCodeImage: UIImage? {
|
||||
colorScheme == .dark ? qrCodeDarkImage : qrCodeLightImage
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func getWidgetBody(uiAvatar: Image, uiQRCode: Image) -> some View {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
HStack(alignment: .center, spacing: 0) {
|
||||
uiQRCode
|
||||
.resizable()
|
||||
.interpolation(.none)
|
||||
.scaledToFit()
|
||||
.widgetURL(URL(string: "\(AppConstants.accountUri)/\(entry.accountId)"))
|
||||
.if(colorScheme == .dark) {
|
||||
$0.padding(4)
|
||||
}
|
||||
|
||||
HStack(alignment: .center) {
|
||||
uiAvatar
|
||||
|
|
|
@ -13,18 +13,15 @@ struct QRCodeSmallWidgetView: View {
|
|||
|
||||
var entry: QRCodeProvider.Entry
|
||||
|
||||
private let qrCodeLightImage: UIImage?
|
||||
private let qrCodeDarkImage: UIImage?
|
||||
private let qrCodeImage: UIImage?
|
||||
|
||||
init(entry: QRCodeProvider.Entry) {
|
||||
self.entry = entry
|
||||
|
||||
if let profileUrl = entry.profileUrl {
|
||||
self.qrCodeLightImage = QRCodeGenerator.shared.generateQRCode(from: profileUrl.absoluteString, scheme: .light)
|
||||
self.qrCodeDarkImage = QRCodeGenerator.shared.generateQRCode(from: profileUrl.absoluteString, scheme: .dark)
|
||||
self.qrCodeImage = QRCodeGenerator.shared.generateQRCode(from: profileUrl.absoluteString)
|
||||
} else {
|
||||
self.qrCodeLightImage = QRCodeGenerator.shared.generateQRCode(from: "https://pixelfed.org", scheme: .light)
|
||||
self.qrCodeDarkImage = QRCodeGenerator.shared.generateQRCode(from: "https://pixelfed.org", scheme: .dark)
|
||||
self.qrCodeImage = QRCodeGenerator.shared.generateQRCode(from: "https://pixelfed.org")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,16 +34,16 @@ struct QRCodeSmallWidgetView: View {
|
|||
}
|
||||
}
|
||||
|
||||
var qrCodeImage: UIImage? {
|
||||
colorScheme == .dark ? qrCodeDarkImage : qrCodeLightImage
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func getWidgetBody(uiAvatar: Image, uiQRCode: Image) -> some View {
|
||||
VStack(spacing: 0) {
|
||||
uiQRCode
|
||||
.resizable()
|
||||
.interpolation(.none)
|
||||
.widgetURL(URL(string: "\(AppConstants.accountUri)/\(entry.accountId)"))
|
||||
.if(colorScheme == .dark) {
|
||||
$0.padding(4)
|
||||
}
|
||||
|
||||
HStack {
|
||||
uiAvatar
|
||||
|
|
|
@ -1231,6 +1231,47 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"global.title.noSearchResult" : {
|
||||
"comment" : "There is nothing here",
|
||||
"localizations" : {
|
||||
"de" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "Es gibt hier nichts"
|
||||
}
|
||||
},
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "There is nothing here"
|
||||
}
|
||||
},
|
||||
"es" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "Aquí no hay nada"
|
||||
}
|
||||
},
|
||||
"eu" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "Hemen ez dago ezer"
|
||||
}
|
||||
},
|
||||
"fr" : {
|
||||
"stringUnit" : {
|
||||
"state" : "needs_review",
|
||||
"value" : "Il n'y a rien ici"
|
||||
}
|
||||
},
|
||||
"pl" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Nic tutaj nie ma"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"global.title.refresh" : {
|
||||
"comment" : "Refresh",
|
||||
"localizations" : {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
import SwiftUI
|
||||
|
||||
public struct NoDataView: View {
|
||||
|
||||
private let imageSystemName: String
|
||||
private let text: LocalizedStringKey
|
||||
|
||||
|
@ -17,14 +16,10 @@ public struct NoDataView: View {
|
|||
}
|
||||
|
||||
public var body: some View {
|
||||
VStack {
|
||||
Image(systemName: self.imageSystemName)
|
||||
.font(.largeTitle)
|
||||
.padding(.bottom, 4)
|
||||
ContentUnavailableView {
|
||||
Label(NSLocalizedString("global.title.noSearchResult", bundle: Bundle.module, comment: "There is nothing here"), systemImage: self.imageSystemName)
|
||||
} description: {
|
||||
Text(self.text, comment: "No data message")
|
||||
.font(.title3)
|
||||
}
|
||||
.foregroundColor(.customGrayColor)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue