Browse Source

Merge pull request #5733 from weseek/feat/gw7783-apply-dark-theme-to-emojiPicker

Apply dark theme to emojiPicker
cao 4 years ago
parent
commit
0c03d41d66
1 changed files with 7 additions and 3 deletions
  1. 7 3
      packages/app/src/components/PageEditor/EmojiPicker.tsx

+ 7 - 3
packages/app/src/components/PageEditor/EmojiPicker.tsx

@@ -1,6 +1,10 @@
 import React, { FC, useRef, useEffect } from 'react';
-import i18n from 'i18next';
+
 import { Picker } from 'emoji-mart';
+import i18n from 'i18next';
+
+import { isDarkMode } from '~/client/util/color-scheme';
+
 import EmojiPickerHelper from './EmojiPickerHelper';
 
 type Props = {
@@ -98,11 +102,11 @@ const EmojiPicker: FC<Props> = (props: Props) => {
   };
 
   const translation = getEmojiTranslation();
-
+  const theme = isDarkMode() ? 'dark' : 'light';
   return (
     <div className="overlay">
       <div ref={emojiPickerContainer}>
-        <Picker autoFocus onSelect={selectEmoji} i18n={translation} title={translation.title} emojiTooltip />
+        <Picker autoFocus onSelect={selectEmoji} i18n={translation} title={translation.title} emojiTooltip theme={theme} />
       </div>
     </div>
   );