File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed
src/frontend/apps/impress/src/features/docs
doc-management/components Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,18 @@ interface EmojiPickerProps {
99 emojiData : EmojiMartData ;
1010 onClickOutside : ( ) => void ;
1111 onEmojiSelect : ( { native } : { native : string } ) => void ;
12+ withOverlay ?: boolean ;
1213}
1314
1415export const EmojiPicker = ( {
1516 emojiData,
1617 onClickOutside,
1718 onEmojiSelect,
19+ withOverlay = false ,
1820} : EmojiPickerProps ) => {
1921 const { i18n } = useTranslation ( ) ;
2022
21- return (
23+ const pickerContent = (
2224 < Box $position = "absolute" $zIndex = { 1000 } $margin = "2rem 0 0 0" >
2325 < Picker
2426 data = { emojiData }
@@ -30,4 +32,27 @@ export const EmojiPicker = ({
3032 />
3133 </ Box >
3234 ) ;
35+
36+ if ( withOverlay ) {
37+ return (
38+ < >
39+ { /* Overlay transparent pour fermer en cliquant à l'extérieur */ }
40+ < div
41+ style = { {
42+ position : 'fixed' ,
43+ top : 0 ,
44+ left : 0 ,
45+ width : '100vw' ,
46+ height : '100vh' ,
47+ zIndex : 999 ,
48+ backgroundColor : 'transparent' ,
49+ } }
50+ onClick = { onClickOutside }
51+ />
52+ { pickerContent }
53+ </ >
54+ ) ;
55+ }
56+
57+ return pickerContent ;
3358} ;
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ export const CalloutBlock = createReactBlockSpec(
8282 emojiData = { emojidata }
8383 onClickOutside = { onClickOutside }
8484 onEmojiSelect = { onEmojiSelect }
85+ withOverlay = { true }
8586 />
8687 ) }
8788 < Box as = "p" className = "inline-content" ref = { contentRef } />
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ export const DocIcon = ({
8080
8181 return (
8282 < >
83- < Box ref = { iconRef } onClick = { toggleEmojiPicker } $position = "relative ">
83+ < Box ref = { iconRef } onClick = { toggleEmojiPicker } color = "tertiary-text ">
8484 { ! emoji ? (
8585 defaultIcon
8686 ) : (
@@ -112,6 +112,7 @@ export const DocIcon = ({
112112 emojiData = { emojidata }
113113 onEmojiSelect = { handleEmojiSelect }
114114 onClickOutside = { handleClickOutside }
115+ withOverlay = { true }
115116 />
116117 </ div > ,
117118 document . body ,
You can’t perform that action at this time.
0 commit comments