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