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 {
9
9
emojiData : EmojiMartData ;
10
10
onClickOutside : ( ) => void ;
11
11
onEmojiSelect : ( { native } : { native : string } ) => void ;
12
+ withOverlay ?: boolean ;
12
13
}
13
14
14
15
export const EmojiPicker = ( {
15
16
emojiData,
16
17
onClickOutside,
17
18
onEmojiSelect,
19
+ withOverlay = false ,
18
20
} : EmojiPickerProps ) => {
19
21
const { i18n } = useTranslation ( ) ;
20
22
21
- return (
23
+ const pickerContent = (
22
24
< Box $position = "absolute" $zIndex = { 1000 } $margin = "2rem 0 0 0" >
23
25
< Picker
24
26
data = { emojiData }
@@ -30,4 +32,27 @@ export const EmojiPicker = ({
30
32
/>
31
33
</ Box >
32
34
) ;
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 ;
33
58
} ;
Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ export const CalloutBlock = createReactBlockSpec(
82
82
emojiData = { emojidata }
83
83
onClickOutside = { onClickOutside }
84
84
onEmojiSelect = { onEmojiSelect }
85
+ withOverlay = { true }
85
86
/>
86
87
) }
87
88
< Box as = "p" className = "inline-content" ref = { contentRef } />
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ export const DocIcon = ({
79
79
80
80
return (
81
81
< >
82
- < Box ref = { iconRef } onClick = { toggleEmojiPicker } $position = "relative ">
82
+ < Box ref = { iconRef } onClick = { toggleEmojiPicker } color = "tertiary-text ">
83
83
{ ! emoji ? (
84
84
defaultIcon
85
85
) : (
@@ -110,6 +110,7 @@ export const DocIcon = ({
110
110
emojiData = { emojidata }
111
111
onEmojiSelect = { handleEmojiSelect }
112
112
onClickOutside = { handleClickOutside }
113
+ withOverlay = { true }
113
114
/>
114
115
</ div > ,
115
116
document . body ,
You can’t perform that action at this time.
0 commit comments