in uui-components/src/overlays/Snackbar.tsx [71:97]
public renderItem(item: NotificationOperation, position: number) {
const isItemOnBottom = item.config.position === 'bot-left' || item.config.position === 'bot-right' || item.config.position === 'bot-center' || !item.config.position;
const isItemOnLeftSide = item.config.position === 'bot-left' || item.config.position === 'top-left' || !item.config.position;
const isItemOnCenter = item.config.position === 'bot-center' || item.config.position === 'top-center';
let style = uuiSnackbar.itemWrapper;
if (isItemOnCenter) {
style = isItemOnBottom ? uuiSnackbar.itemWrapperBottomCenter : uuiSnackbar.itemWrapperCenter;
} else if (!isItemOnLeftSide) {
style = uuiSnackbar.itemWrapperRight;
}
const transitionRef = React.createRef<HTMLDivElement>();
let className;
if (isItemOnLeftSide) {
className = uuiSnackbar.itemWrapper.self;
} else {
className = isItemOnCenter ? uuiSnackbar.itemWrapperCenter.self : uuiSnackbar.itemWrapperRight.self;
}
return (
<CSSTransition nodeRef={ transitionRef } classNames={ style } timeout={ 200 } key={ item.props.id }>
<div
ref={ transitionRef }
className={ className }
key={ item.props.key }
style={ isItemOnBottom ? { bottom: position } : { top: position } }
>
<div className={ cx(uuiSnackbar.item.self) } ref={ (node) => this.updateHeight(item, node) }>