@selfcommunity/react-core
Version:
React Core Components useful for integrating UI Community components (react-ui).
18 lines (17 loc) • 662 B
TypeScript
import { SCFeatureName } from '@selfcommunity/types';
/**
* Custom hook preferences and features at the same time
* @param preferences - array of preference keys
* @param features - array of feature keys
* @returns boolean - true only if all preferences and features are enabled
*
* Ex.
* const isEnabled = useSCPreferencesAndFeaturesEnabled(
* [
* SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED,
* SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED
* ],
* [SCFeatureName.TAGGING]
* );
*/
export default function useSCPreferencesAndFeaturesEnabled(preferences: string[], features?: SCFeatureName[]): boolean;