@@ -4,7 +4,7 @@ import { List as ImmutableList, Map as ImmutableMap } from 'immutable';
44import React , { useCallback , useEffect , useRef , useState } from 'react' ;
55import { defineMessages , useIntl } from 'react-intl' ;
66
7- import { buildCustomEmojis } from '../../../emoji/emoji' ;
7+ import { buildCustomEmojis , categoriesFromEmojis } from '../../../emoji/emoji' ;
88
99import { EmojiPicker } from './emoji-picker-dropdown' ;
1010import ModifierPicker from './modifier-picker' ;
@@ -14,19 +14,6 @@ import type { Emoji } from 'soapbox/components/autosuggest-emoji';
1414const backgroundImageFn = ( ) => require ( 'emoji-datasource/img/twitter/sheets/32.png' ) ;
1515const listenerOptions = supportsPassiveEvents ? { passive : true } : false ;
1616
17- const categoriesSort = [
18- 'recent' ,
19- 'custom' ,
20- 'people' ,
21- 'nature' ,
22- 'foods' ,
23- 'activity' ,
24- 'places' ,
25- 'objects' ,
26- 'symbols' ,
27- 'flags' ,
28- ] ;
29-
3017const messages = defineMessages ( {
3118 emoji : { id : 'emoji_button.label' , defaultMessage : 'Insert emoji' } ,
3219 emoji_search : { id : 'emoji_button.search' , defaultMessage : 'Search…' } ,
@@ -71,6 +58,20 @@ const EmojiPickerMenu: React.FC<IEmojiPickerMenu> = ({
7158
7259 const [ modifierOpen , setModifierOpen ] = useState ( false ) ;
7360
61+ const categoriesSort = [
62+ 'recent' ,
63+ 'people' ,
64+ 'nature' ,
65+ 'foods' ,
66+ 'activity' ,
67+ 'places' ,
68+ 'objects' ,
69+ 'symbols' ,
70+ 'flags' ,
71+ ] ;
72+
73+ categoriesSort . splice ( 1 , 0 , ...Array . from ( categoriesFromEmojis ( customEmojis ) as Set < string > ) . sort ( ) ) ;
74+
7475 const handleDocumentClick = useCallback ( e => {
7576 if ( node . current && ! node . current . contains ( e . target ) ) {
7677 onClose ( ) ;
0 commit comments