EmojiPickerDropdown: minor refactoring
This commit is contained in:
parent
cefe9adc05
commit
0b0a548f8c
|
@ -5,7 +5,7 @@ import { createSelector } from 'reselect';
|
||||||
|
|
||||||
import { useEmoji } from 'soapbox/actions/emojis';
|
import { useEmoji } from 'soapbox/actions/emojis';
|
||||||
import { changeSetting } from 'soapbox/actions/settings';
|
import { changeSetting } from 'soapbox/actions/settings';
|
||||||
import { useAppDispatch, useAppSelector, useSettings } from 'soapbox/hooks';
|
import { useAppDispatch, useAppSelector, useTheme } from 'soapbox/hooks';
|
||||||
import { RootState } from 'soapbox/store';
|
import { RootState } from 'soapbox/store';
|
||||||
|
|
||||||
import { buildCustomEmojis } from '../../emoji';
|
import { buildCustomEmojis } from '../../emoji';
|
||||||
|
@ -130,10 +130,8 @@ const EmojiPickerDropdown: React.FC<IEmojiPickerDropdown> = ({
|
||||||
}) => {
|
}) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const settings = useSettings();
|
|
||||||
const title = intl.formatMessage(messages.emoji);
|
const title = intl.formatMessage(messages.emoji);
|
||||||
const userTheme = settings.get('themeMode');
|
const theme = useTheme();
|
||||||
const theme = (userTheme === 'dark' || userTheme === 'light') ? userTheme : 'auto';
|
|
||||||
|
|
||||||
const customEmojis = useAppSelector((state) => getCustomEmojis(state));
|
const customEmojis = useAppSelector((state) => getCustomEmojis(state));
|
||||||
const frequentlyUsedEmojis = useAppSelector((state) => getFrequentlyUsedEmojis(state));
|
const frequentlyUsedEmojis = useAppSelector((state) => getFrequentlyUsedEmojis(state));
|
||||||
|
|
|
@ -18,7 +18,6 @@ const EmojiPickerDropdownContainer = (
|
||||||
) => {
|
) => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const title = intl.formatMessage(messages.emoji);
|
const title = intl.formatMessage(messages.emoji);
|
||||||
|
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
|
|
||||||
const { x, y, strategy, refs, update } = useFloating<HTMLButtonElement>({
|
const { x, y, strategy, refs, update } = useFloating<HTMLButtonElement>({
|
||||||
|
|
Loading…
Reference in New Issue