diff --git a/ts/components/conversation/SessionEmojiPanel.tsx b/ts/components/conversation/SessionEmojiPanel.tsx index 57cc44063..44b519a04 100644 --- a/ts/components/conversation/SessionEmojiPanel.tsx +++ b/ts/components/conversation/SessionEmojiPanel.tsx @@ -1,4 +1,4 @@ -import React, { forwardRef, useEffect, useState } from 'react'; +import React, { forwardRef } from 'react'; import classNames from 'classnames'; import styled from 'styled-components'; // @ts-ignore @@ -103,31 +103,29 @@ export const SessionEmojiPanel = forwardRef((props: Props const theme = useSelector(getTheme); const isDarkMode = useSelector(isDarkTheme); - const [panelBackgroundRGB, setPanelBackgroundRGB] = useState(''); - const [panelTextRGB, setPanelTextRGB] = useState(''); + let panelBackgroundRGB = hexColorToRGB(THEMES.CLASSIC_DARK.COLOR1); + let panelTextRGB = hexColorToRGB(THEMES.CLASSIC_DARK.COLOR6); - useEffect(() => { - switch (theme) { - case 'ocean-dark': - setPanelBackgroundRGB(hexColorToRGB(THEMES.OCEAN_DARK.COLOR1)); - // tslint:disable: no-non-null-assertion - setPanelTextRGB(hexColorToRGB(THEMES.OCEAN_DARK.COLOR7!)); - break; - case 'ocean-light': - // tslint:disable: no-non-null-assertion - setPanelBackgroundRGB(hexColorToRGB(THEMES.OCEAN_LIGHT.COLOR7!)); - setPanelTextRGB(hexColorToRGB(THEMES.OCEAN_LIGHT.COLOR1)); - break; - case 'classic-light': - setPanelBackgroundRGB(hexColorToRGB(THEMES.CLASSIC_LIGHT.COLOR6)); - setPanelTextRGB(hexColorToRGB(THEMES.CLASSIC_LIGHT.COLOR0)); - break; - case 'classic-dark': - default: - setPanelBackgroundRGB(hexColorToRGB(THEMES.CLASSIC_DARK.COLOR1)); - setPanelTextRGB(hexColorToRGB(THEMES.CLASSIC_DARK.COLOR6)); - } - }, [theme]); + switch (theme) { + case 'ocean-dark': + panelBackgroundRGB = hexColorToRGB(THEMES.OCEAN_DARK.COLOR1); + // tslint:disable: no-non-null-assertion + panelTextRGB = hexColorToRGB(THEMES.OCEAN_DARK.COLOR7!); + break; + case 'ocean-light': + // tslint:disable: no-non-null-assertion + panelBackgroundRGB = hexColorToRGB(THEMES.OCEAN_LIGHT.COLOR7!); + panelTextRGB = hexColorToRGB(THEMES.OCEAN_LIGHT.COLOR1); + break; + case 'classic-light': + panelBackgroundRGB = hexColorToRGB(THEMES.CLASSIC_LIGHT.COLOR6); + panelTextRGB = hexColorToRGB(THEMES.CLASSIC_LIGHT.COLOR0); + break; + case 'classic-dark': + default: + panelBackgroundRGB = hexColorToRGB(THEMES.CLASSIC_DARK.COLOR1); + panelTextRGB = hexColorToRGB(THEMES.CLASSIC_DARK.COLOR6); + } return (