|
|
@ -9,8 +9,9 @@ import { getTheme } from '../../state/selectors/theme';
|
|
|
|
import { noop } from 'lodash';
|
|
|
|
import { noop } from 'lodash';
|
|
|
|
import { loadEmojiPanelI18n } from '../../util/i18n';
|
|
|
|
import { loadEmojiPanelI18n } from '../../util/i18n';
|
|
|
|
import { FixedBaseEmoji, FixedPickerProps } from '../../types/Reaction';
|
|
|
|
import { FixedBaseEmoji, FixedPickerProps } from '../../types/Reaction';
|
|
|
|
|
|
|
|
import { ThemeStateType } from '../../themes/colors.js';
|
|
|
|
|
|
|
|
|
|
|
|
export const StyledEmojiPanel = styled.div<{ isModal: boolean; theme: 'light' | 'dark' }>`
|
|
|
|
export const StyledEmojiPanel = styled.div<{ isModal: boolean; theme: ThemeStateType }>`
|
|
|
|
padding: var(--margins-lg);
|
|
|
|
padding: var(--margins-lg);
|
|
|
|
z-index: 5;
|
|
|
|
z-index: 5;
|
|
|
|
opacity: 0;
|
|
|
|
opacity: 0;
|
|
|
@ -40,15 +41,20 @@ export const StyledEmojiPanel = styled.div<{ isModal: boolean; theme: 'light' |
|
|
|
|
|
|
|
|
|
|
|
|
${props => {
|
|
|
|
${props => {
|
|
|
|
switch (props.theme) {
|
|
|
|
switch (props.theme) {
|
|
|
|
// TODO Theming - Add Ocean Colors
|
|
|
|
case 'ocean-dark':
|
|
|
|
case 'dark':
|
|
|
|
// TODO Theming
|
|
|
|
|
|
|
|
return ``;
|
|
|
|
|
|
|
|
case 'ocean-light':
|
|
|
|
|
|
|
|
// TODO Theming
|
|
|
|
|
|
|
|
return ``;
|
|
|
|
|
|
|
|
case 'classic-dark':
|
|
|
|
return `
|
|
|
|
return `
|
|
|
|
--background-rgb: 27, 27, 27; // var(--color-cell-background)
|
|
|
|
--background-rgb: 27, 27, 27; // var(--color-cell-background)
|
|
|
|
--rgb-background: 27, 27, 27;
|
|
|
|
--rgb-background: 27, 27, 27;
|
|
|
|
--rgb-color: 255, 255, 255; // var(--color-text)
|
|
|
|
--rgb-color: 255, 255, 255; // var(--color-text)
|
|
|
|
--rgb-input: 27, 27, 27;
|
|
|
|
--rgb-input: 27, 27, 27;
|
|
|
|
`;
|
|
|
|
`;
|
|
|
|
case 'light':
|
|
|
|
case 'classic-light':
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return `
|
|
|
|
return `
|
|
|
|
--background-rgb: 249, 249, 249; // var(--color-cell-background)
|
|
|
|
--background-rgb: 249, 249, 249; // var(--color-cell-background)
|
|
|
@ -97,6 +103,7 @@ const pickerProps: FixedPickerProps = {
|
|
|
|
export const SessionEmojiPanel = forwardRef<HTMLDivElement, Props>((props: Props, ref) => {
|
|
|
|
export const SessionEmojiPanel = forwardRef<HTMLDivElement, Props>((props: Props, ref) => {
|
|
|
|
const { onEmojiClicked, show, isModal = false, onKeyDown } = props;
|
|
|
|
const { onEmojiClicked, show, isModal = false, onKeyDown } = props;
|
|
|
|
const theme = useSelector(getTheme);
|
|
|
|
const theme = useSelector(getTheme);
|
|
|
|
|
|
|
|
const emojiPanelTheme = theme.includes('light') ? 'light' : 'dark';
|
|
|
|
const pickerRef = ref as MutableRefObject<HTMLDivElement>;
|
|
|
|
const pickerRef = ref as MutableRefObject<HTMLDivElement>;
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
@ -113,7 +120,7 @@ export const SessionEmojiPanel = forwardRef<HTMLDivElement, Props>((props: Props
|
|
|
|
data,
|
|
|
|
data,
|
|
|
|
ref,
|
|
|
|
ref,
|
|
|
|
i18n,
|
|
|
|
i18n,
|
|
|
|
theme,
|
|
|
|
theme: emojiPanelTheme,
|
|
|
|
onEmojiSelect: onEmojiClicked,
|
|
|
|
onEmojiSelect: onEmojiClicked,
|
|
|
|
onKeyDown,
|
|
|
|
onKeyDown,
|
|
|
|
...pickerProps,
|
|
|
|
...pickerProps,
|
|
|
|