This commit is contained in:
neon443 committed 2026-04-08 20:43:14 +01:00
1 parent d79b0557a9
commit 7d7308b274
3 files changed
+18 -19

No files matched your search

@@ -11,12 +11,13 @@ struct EmojiPack: Identifiable, Codable {
var id: UUID var id: UUID
var name: String var name: String
var description: String var description: String
var items: [EmojiPack.Item] var items: [String]
// var items: [EmojiPack.Item]
struct Item: Identifiable, Codable, Equatable { // struct Item: Identifiable, Codable, Equatable {
var id: UUID // var id: UUID
var name: String // var name: String
} // }
} }
extension EmojiPack { extension EmojiPack {
+8 -8
View File
@@ -127,14 +127,14 @@ extension EmojiPack {
name: "test pack", name: "test pack",
description: "neon443's debug emoji pack", description: "neon443's debug emoji pack",
items: [ items: [
Item(id: UUID(uuidString: "06b65aee-8831-466a-b003-1feed53695ec")!, name: "pf"), "pf",
Item(id: UUID(uuidString: "b93f296b-6fd9-4aeb-8345-159d11f448c4")!, name: "heavysob"), "heavysob",
Item(id: UUID(uuidString: "ce03516a-61cf-429d-85e8-fe439e95b3dd")!, name: "yay"), "yay",
Item(id: UUID(uuidString: "c0bd5d04-c71f-40b3-ab8d-f49b07518f74")!, name: "skulk"), "skulk",
Item(id: UUID(uuidString: "f6c0d4e0-5bf7-4d23-89fb-f415c132519a")!, name: "loll"), "loll",
Item(id: UUID(uuidString: "263dc294-6d98-4a85-bf82-f40602855e2b")!, name: "bleh"), "bleh",
Item(id: UUID(uuidString: "df504b1d-f9bc-4b2c-b092-491b5850e508")!, name: "uhh"), "uhh",
Item(id: UUID(uuidString: "896efcce-3021-4a3f-9847-e0f8fdd64d9a")!, name: "communist") "communist"
] ]
) )
} }
@@ -85,8 +85,8 @@ struct EmojiPackDetailView: View {
let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing))) let columns: Int = max(1, Int((geo.size.width - 2*spacing) / (minColWidth + spacing)))
let layout = Array(repeating: col, count: columns) let layout = Array(repeating: col, count: columns)
LazyVGrid(columns: layout, spacing: spacing) { LazyVGrid(columns: layout, spacing: spacing) {
ForEach(pack.items) { item in ForEach(pack.items, id: \.self) { name in
let emoji = hoarder.trie.dict[item.name] ?? .test let emoji = hoarder.trie.dict[name] ?? .test
VStack { VStack {
StickerPreview(sticker: emoji) StickerPreview(sticker: emoji)
Spacer() Spacer()
@@ -98,7 +98,7 @@ struct EmojiPackDetailView: View {
if edit { if edit {
Button(role: .destructive) { Button(role: .destructive) {
withAnimation(.spring) { withAnimation(.spring) {
pack.items.removeAll { $0.id == item.id } pack.items.removeAll { $0 == name }
} }
} label: { } label: {
Image(systemName: "minus.circle.fill") Image(systemName: "minus.circle.fill")
@@ -131,9 +131,7 @@ struct EmojiPackDetailView: View {
guard let id = UUID(uuidString: selection.id) else { guard let id = UUID(uuidString: selection.id) else {
fatalError("bruh what happened to ur uuid") fatalError("bruh what happened to ur uuid")
} }
pack.items.append( pack.items.append(selection.name)
EmojiPack.Item(id: id, name: selection.name)
)
} }
} }
} }
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.