mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
added messagesrootviewcontroller for the split pane thingy added messagespacklistview to select packs n stuff added .description to packs for easier display updated stickerdatasource to take a pack for filtering messagesvc needs to be cleaned ps i tried a splitviewcontroller but it didnt do the split
62 lines
1.2 KiB
Swift
62 lines
1.2 KiB
Swift
//
|
|
// EmojiPackPreview.swift
|
|
// StickerSlack
|
|
//
|
|
// Created by neon443 on 01/07/2026.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct EmojiPackPreview: View {
|
|
@ObservedObject var hoarder: EmojiHoarder
|
|
@State var pack: EmojiPack
|
|
|
|
var allDownloaded: Bool {
|
|
pack.allDownloaded(in: hoarder)
|
|
}
|
|
var body: some View {
|
|
NavigationView2 {
|
|
VStack {
|
|
Text(pack.name.isEmpty ? "Name" : pack.name)
|
|
.bold()
|
|
.foregroundStyle(.primary)
|
|
.font(.title)
|
|
|
|
if pack.items.isEmpty {
|
|
EmptyCollectionView(
|
|
title: "No Emoji",
|
|
details: "Add emojis to this pack",
|
|
systemImage: "exclamationmark.triangle.fill"
|
|
)
|
|
}
|
|
|
|
EmojiCollectionViewRepresentable(
|
|
hoarder: hoarder,
|
|
items: pack.items,
|
|
width: 75,
|
|
style: .full,
|
|
onRemoveSUI: { pack.remove($0) }
|
|
)
|
|
|
|
if !pack.items.isEmpty {
|
|
Text(pack.description)
|
|
.bold()
|
|
.multilineTextAlignment(.center)
|
|
.shadow(radius: 5)
|
|
.padding(.bottom)
|
|
}
|
|
}
|
|
.transition(.scale)
|
|
.navigationTitle("Pack Details")
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
.onDisappear {
|
|
hoarder.saveEmojiPacks()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
EmojiPackPreview(hoarder: EmojiHoarder(), pack: .test)
|
|
}
|