2022-10-20 12:11:27 +03:00
|
|
|
import { IReduxState } from '../app/types';
|
2023-04-27 19:19:53 -05:00
|
|
|
|
2024-02-29 17:39:13 -06:00
|
|
|
import { isReactionsEnabled } from './functions.any';
|
2022-09-05 14:24:13 +03:00
|
|
|
|
2023-03-31 14:04:33 +03:00
|
|
|
export * from './functions.any';
|
|
|
|
|
|
2021-07-13 09:50:08 +03:00
|
|
|
/**
|
|
|
|
|
* Returns the visibility state of the reactions menu.
|
|
|
|
|
*
|
|
|
|
|
* @param {Object} state - The state of the application.
|
2022-07-11 14:30:37 +02:00
|
|
|
* @returns {boolean}
|
2021-07-13 09:50:08 +03:00
|
|
|
*/
|
2022-10-20 12:11:27 +03:00
|
|
|
export function getReactionsMenuVisibility(state: IReduxState): boolean {
|
2021-07-13 09:50:08 +03:00
|
|
|
return state['features/reactions'].visible;
|
|
|
|
|
}
|
2023-04-27 19:19:53 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Whether or not the reactions button is enabled.
|
|
|
|
|
*
|
|
|
|
|
* @param {Object} state - The Redux state object.
|
|
|
|
|
* @returns {boolean}
|
|
|
|
|
*/
|
|
|
|
|
export function isReactionsButtonEnabled(state: IReduxState) {
|
2024-02-28 13:52:04 -06:00
|
|
|
const { toolbarButtons } = state['features/toolbox'];
|
|
|
|
|
|
2024-02-29 17:39:13 -06:00
|
|
|
return Boolean(toolbarButtons?.includes('reactions')) && isReactionsEnabled(state);
|
2023-04-27 19:19:53 -05:00
|
|
|
}
|