feat: ship creator journey v2 and profile updates
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import React, { useState, useRef, useEffect, useCallback } from 'react'
|
||||
import { createPortal } from 'react-dom'
|
||||
import EmojiMartPicker from '../common/EmojiMartPicker'
|
||||
import extractNativeEmoji from '../common/extractNativeEmoji'
|
||||
import isEventWithinNode from '../common/isEventWithinNode'
|
||||
import loadEmojiMartData from '../common/loadEmojiMartData'
|
||||
|
||||
/**
|
||||
@@ -58,8 +60,7 @@ export default function EmojiPicker({ onSelect, editor }) {
|
||||
useEffect(() => {
|
||||
if (!open) return
|
||||
const handler = (e) => {
|
||||
if (panelRef.current && !panelRef.current.contains(e.target) &&
|
||||
buttonRef.current && !buttonRef.current.contains(e.target)) {
|
||||
if (!isEventWithinNode(e, panelRef.current) && !isEventWithinNode(e, buttonRef.current)) {
|
||||
setOpen(false)
|
||||
}
|
||||
}
|
||||
@@ -76,7 +77,12 @@ export default function EmojiPicker({ onSelect, editor }) {
|
||||
}, [open])
|
||||
|
||||
const handleSelect = useCallback((emoji) => {
|
||||
const native = emoji.native ?? ''
|
||||
const native = extractNativeEmoji(emoji)
|
||||
if (!native) {
|
||||
setOpen(false)
|
||||
return
|
||||
}
|
||||
|
||||
onSelect?.(native)
|
||||
if (editor) {
|
||||
editor.chain().focus().insertContent(native).run()
|
||||
|
||||
Reference in New Issue
Block a user