File size: 477 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import config from '@automattic/calypso-config';
export default function isSectionEnabled( section ) {
return isSectionNameEnabled( section.name );
}
export function isSectionNameEnabled( sectionName ) {
const activeSections = config( 'sections' );
const byDefaultEnableSection = config( 'enable_all_sections' );
if ( activeSections && typeof activeSections[ sectionName ] !== 'undefined' ) {
return activeSections[ sectionName ];
}
return byDefaultEnableSection;
}
|