From dfec231aca55c6cf4180d57831444f1bb2da3bbb Mon Sep 17 00:00:00 2001 From: Nihaal Sharma <69979447+neon443@users.noreply.github.com> Date: Tue, 30 Jun 2026 21:57:47 +0100 Subject: [PATCH] jfal;sd --- .../SwiftUI/Misc/EmptyCollectionView.swift | 14 +++--- StickerSlack/SwiftUI/SearchView.swift | 43 +------------------ StickerSlack/UIKit/TabbedContentView.swift | 24 +++++------ 3 files changed, 19 insertions(+), 62 deletions(-) diff --git a/StickerSlack/SwiftUI/Misc/EmptyCollectionView.swift b/StickerSlack/SwiftUI/Misc/EmptyCollectionView.swift index 7c609d6..c82845d 100644 --- a/StickerSlack/SwiftUI/Misc/EmptyCollectionView.swift +++ b/StickerSlack/SwiftUI/Misc/EmptyCollectionView.swift @@ -24,12 +24,14 @@ struct EmptyCollectionView: View { .bold() .font(.title3) } - HStack { - Spacer() - Text(details) - .multilineTextAlignment(.center) - .foregroundStyle(.gray) - Spacer() + if !details.isEmpty { + HStack { + Spacer() + Text(details) + .multilineTextAlignment(.center) + .foregroundStyle(.gray) + Spacer() + } } } .listRowSeparator(.hidden) diff --git a/StickerSlack/SwiftUI/SearchView.swift b/StickerSlack/SwiftUI/SearchView.swift index a271dc7..884e235 100644 --- a/StickerSlack/SwiftUI/SearchView.swift +++ b/StickerSlack/SwiftUI/SearchView.swift @@ -58,14 +58,12 @@ struct SearchView: View { var body: some View { VStack { if searchTerm.isEmpty { - EmptyCollectionView(title: "Search", details: "", systemImage: "magnifyingglass") + EmptyCollectionView(title: "Start a Search", details: "", systemImage: "magnifyingglass") .frame(maxHeight: 100) - .padding() Spacer() } else if searchResult.isEmpty { EmptyCollectionView(title: "No Results", details: "Try a new search", systemImage: "exclamationmark.magnifyingglass") .frame(maxHeight: 100) - .padding() Spacer() } else if fromPackEditor { EmojiCollectionViewRepresentable( @@ -78,45 +76,6 @@ struct SearchView: View { } else { EmojiTableViewRepresentable(hoarder: hoarder, items: searchResult) } - - if fromPackEditor { - if searchResult.isEmpty { - EmptyCollectionView(title: "No Results", details: "Try a new search", systemImage: "exclamationmark.magnifyingglass") - .frame(maxHeight: 100) - .padding() - Spacer() - } else { - EmojiCollectionViewRepresentable( - hoarder: hoarder, - items: searchResult, - width: 75, - style: .plainWithLabel, - onTapCallback: { callback($0) - }) - } - } else { - switch stickerType { - case .slackEmoji: - Text("\(searchResult.count)") - if searchResult.isEmpty { - EmptyCollectionView(title: "No Results", details: "Try a new search", systemImage: "exclamationmark.magnifyingglass") - .frame(maxHeight: 100) - .padding() - Spacer() - } else { - EmojiTableViewRepresentable(hoarder: hoarder, items: searchResult) - } - case .giphyGifs: - Text("uhh") - } - Picker("", selection: $stickerType) { - ForEach(StickerType.allCases) { type in - Text(type.description).tag(type) - } - } - .pickerStyle(.segmented) - .padding(.horizontal) - } } .searchable(text: $searchTerm) .onChange(of: searchTerm) { new in diff --git a/StickerSlack/UIKit/TabbedContentView.swift b/StickerSlack/UIKit/TabbedContentView.swift index 8af82f7..0dadbe8 100644 --- a/StickerSlack/UIKit/TabbedContentView.swift +++ b/StickerSlack/UIKit/TabbedContentView.swift @@ -13,17 +13,17 @@ final class TabbedContentView: UITabBarController { override func viewDidLoad() { super.viewDidLoad() - self.edgesForExtendedLayout = .bottom - self.extendedLayoutIncludesOpaqueBars = false +// self.edgesForExtendedLayout = .bottom +// self.extendedLayoutIncludesOpaqueBars = false - if #available(iOS 26, *) { - let appearance = UITabBarAppearance() - appearance.configureWithDefaultBackground() - tabBar.standardAppearance = appearance - tabBar.scrollEdgeAppearance = appearance - } else { - self.tabBarController?.tabBar.isTranslucent = false - } +// if #available(iOS 26, *) { +// let appearance = UITabBarAppearance() +// appearance.configureWithDefaultBackground() +// tabBar.standardAppearance = appearance +// tabBar.scrollEdgeAppearance = appearance +// } else { +// self.tabBarController?.tabBar.isTranslucent = false +// } setupTabs() } @@ -51,10 +51,6 @@ final class TabbedContentView: UITabBarController { downloadedView.navigationItem.title = "Downloaded" downloaded.tabBarItem = UITabBarItem(title: "Downloaded", image: UIImage(systemName: "arrow.down.circle.fill"), tag: 2) -// let downloadedView = DownloadedView(emojiHoarder: emojiHoarder, gifHoarder: gifHoarder) -// let downloaded = UIHostingController(rootView: downloadedView) -// downloaded.tabBarItem = UITabBarItem(title: "Downloaded", image: UIImage(systemName: "arrow.down.circle.fill"), tag: 2) - let settingsView = SettingsView(hoarder: emojiHoarder) let settings = UIHostingController(rootView: settingsView) settings.tabBarItem = UITabBarItem(title: "Settings", image: UIImage(systemName: "gear"), tag: 3)