Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
calculateNumberOfColumns() {
const bottomSheetWidth = BottomSheet.getWidth();
const { paddingLeft: itemPaddingLeft, paddingRight: itemPaddingRight } = styles.modalItem;
const { paddingLeft: containerPaddingLeft, paddingRight: containerPaddingRight } = styles.content;
const { width: itemWidth } = styles.modalIconWrapper;
const itemTotalWidth = itemWidth + itemPaddingLeft + itemPaddingRight;
const containerTotalWidth = bottomSheetWidth - ( containerPaddingLeft + containerPaddingRight );
return Math.floor( containerTotalWidth / itemTotalWidth );
}
calculateNumberOfColumns() {
const bottomSheetWidth = BottomSheet.getWidth();
const { paddingLeft: itemPaddingLeft, paddingRight: itemPaddingRight } = styles.modalItem;
const { paddingLeft: containerPaddingLeft, paddingRight: containerPaddingRight } = styles.content;
const { width: itemWidth } = styles.modalIconWrapper;
const itemTotalWidth = itemWidth + itemPaddingLeft + itemPaddingRight;
const containerTotalWidth = bottomSheetWidth - ( containerPaddingLeft + containerPaddingRight );
return Math.floor( containerTotalWidth / itemTotalWidth );
}
}
calculateNumberOfColumns() {
const bottomSheetWidth = BottomSheet.getWidth();
const { paddingLeft: itemPaddingLeft, paddingRight: itemPaddingRight } = styles.modalItem;
const { paddingLeft: containerPaddingLeft, paddingRight: containerPaddingRight } = styles.content;
const { width: itemWidth } = styles.modalIconWrapper;
const itemTotalWidth = itemWidth + itemPaddingLeft + itemPaddingRight;
const containerTotalWidth = bottomSheetWidth - ( containerPaddingLeft + containerPaddingRight );
return Math.floor( containerTotalWidth / itemTotalWidth );
}
}