1 import { IReduxState } from '../app/types'; 2 import { getToolbarButtons } from '../base/config/functions.web'; 3 4 import { isReactionsEnabled } from './functions.any'; 5 6 export * from './functions.any'; 7 8 /** 9 * Returns the visibility state of the reactions menu. 10 * 11 * @param {Object} state - The state of the application. 12 * @returns {boolean} 13 */ 14 export function getReactionsMenuVisibility(state: IReduxState): boolean { 15 return state['features/reactions'].visible; 16 } 17 18 /** 19 * Whether or not the reactions button is enabled. 20 * 21 * @param {Object} state - The Redux state object. 22 * @returns {boolean} 23 */ 24 export function isReactionsButtonEnabled(state: IReduxState) { 25 return Boolean(getToolbarButtons(state).includes('reactions')) && isReactionsEnabled(state); 26 }