| Server IP : 185.252.147.100 / Your IP : 216.73.217.33 Web Server : nginx/1.27.3 System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 User : mitr ( 1000) PHP Version : 8.2.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/html/ephotel.ru/wordpress/wp-content/plugins/generateblocks/src/utils/is-flex-item/ |
Upload File : |
export default function isFlexItem( props ) {
const {
device,
display,
displayTablet,
displayMobile,
computedStyles = { display: '' },
} = props;
// Check for a computed value if one is provided
const { display: computedValue = '' } = computedStyles;
// If the computed style is flex, we can assume it's a flex item.
if ( 'flex' === computedValue ) {
return true;
}
// Check local attributes to determine if a flex item
let flexItem = false;
if ( 'Desktop' === device && display.includes( 'flex' ) ) {
flexItem = true;
}
if ( 'Tablet' === device ) {
if (
( displayTablet && displayTablet.includes( 'flex' ) ) ||
( ! displayTablet && display.includes( 'flex' ) )
) {
flexItem = true;
}
}
if ( 'Mobile' === device ) {
if (
( displayMobile && displayMobile.includes( 'flex' ) ) ||
( ! displayMobile && displayTablet && displayTablet.includes( 'flex' ) ) ||
( ! displayMobile && ! displayTablet && display.includes( 'flex' ) )
) {
flexItem = true;
}
}
return flexItem;
}