some stuff

This commit is contained in:
neon443 committed 2026-04-28 12:21:55 +01:00
1 parent 29e8bd7e09
commit 3348e971eb
2 files changed
+3 -4

No files matched your search

@@ -21,8 +21,7 @@ struct EmojiCollectionView: UIViewRepresentable {
func makeUIView(context: Context) -> UICollectionView { func makeUIView(context: Context) -> UICollectionView {
let collectionView = context.coordinator as UICollectionViewController let collectionView = context.coordinator as UICollectionViewController
collectionView.collectionView.register(PlainEmojiCollectionViewCell.self, forCellWithReuseIdentifier: "plain") collectionView.collectionView.register(PlainEmojiCollectionViewCell.self, forCellWithReuseIdentifier: "plain")
collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "plainWithMenu") collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "full")
collectionView.collectionView.register(EmojiCollectionViewCell.self, forCellWithReuseIdentifier: "full")
collectionView.collectionView.dataSource = context.coordinator collectionView.collectionView.dataSource = context.coordinator
collectionView.collectionView.delegate = context.coordinator collectionView.collectionView.delegate = context.coordinator
return collectionView.collectionView return collectionView.collectionView
@@ -163,11 +162,12 @@ struct EmojiCollectionView: UIViewRepresentable {
let share = UIAction(title: "Share", image: UIImage(systemName: "square.and.arrow.up")) { action in let share = UIAction(title: "Share", image: UIImage(systemName: "square.and.arrow.up")) { action in
} }
let delete = UIAction(title: "Delete", image: UIImage(systemName: "plus")) { action in let delete = UIAction(title: "Delete", image: UIImage(systemName: "trash")) { action in
Task.detached { Task.detached {
await self.hoarder.delete(emoji: self.hoarder.trie.dict[emojiName]) await self.hoarder.delete(emoji: self.hoarder.trie.dict[emojiName])
} }
} }
delete.attributes.update(with: .destructive)
return UIMenu(title: emojiName, children: [copyName, copyImage, share, delete]) return UIMenu(title: emojiName, children: [copyName, copyImage, share, delete])
} }
} }
@@ -50,7 +50,6 @@ class PlainEmojiCollectionViewCell: UICollectionViewCell {
NSLayoutConstraint.activate( NSLayoutConstraint.activate(
[ [
hostingController.view.topAnchor.constraint(equalTo: contentView.topAnchor), hostingController.view.topAnchor.constraint(equalTo: contentView.topAnchor),
// hostingController.view.bottomAnchor.constraint(equalTo: contentView.topAnchor, ),
hostingController.view.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), hostingController.view.leadingAnchor.constraint(equalTo: contentView.leadingAnchor),
hostingController.view.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), hostingController.view.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
hostingController.view.heightAnchor.constraint(equalTo: hostingController.view.widthAnchor) hostingController.view.heightAnchor.constraint(equalTo: hostingController.view.widthAnchor)
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.