Merge branch 'main' into nav-client-events

This commit is contained in:
Alex Benzer
2026-05-25 21:18:43 -07:00
parent f3d2470766
commit bc731ef0d3
137 changed files with 9143 additions and 6464 deletions
@@ -1,11 +1,12 @@
import ExpoModulesCore
import WebKit
import MCEmojiPicker
class EmojiPickerView: ExpoView, MCEmojiPickerDelegate {
let onEmojiSelected = EventDispatcher()
override func layoutSubviews() {
required init(appContext: AppContext? = nil) {
super.init(appContext: appContext)
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap(_:)))
self.addGestureRecognizer(tapGesture)
}
@@ -19,9 +20,19 @@ class EmojiPickerView: ExpoView, MCEmojiPickerDelegate {
let reactRootVC = reactViewController()
emojiPicker.sourceView = self
emojiPicker.delegate = self
emojiPicker.arrowDirection = preferredArrowDirection()
reactRootVC?.present(emojiPicker, animated: true)
}
/// If the trigger sits in the bottom third of the screen there isn't enough
/// room below it for a usable popover, so anchor the picker above instead.
private func preferredArrowDirection() -> MCPickerArrowDirection {
guard let window = self.window else { return .up }
let frameInWindow = self.convert(self.bounds, to: window)
let threshold = window.bounds.height * (2.0 / 3.0)
return frameInWindow.midY >= threshold ? .down : .up
}
func didGetEmoji(emoji: String) {
onEmojiSelected([
"emoji": emoji