Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elementRef: this.props.contentRef,
background: color,
stacking: this.props.stacking,
shadow: this.props.shadow,
display: 'block'
}
const { placement } = this.state
if (this.props.withArrow) {
ViewElement = ContextView
viewProps = {
...viewProps,
// TODO: remove background override after contextview is updated
background: color === 'primary' ? 'default' : 'inverse',
placement: this.rtl ? mirrorHorizontalPlacement(placement, ' ') : placement
}
} else {
ViewElement = View
viewProps = {
...viewProps,
borderWidth: 'small',
borderRadius: 'medium'
}
}
return (
{content}
)
} else {
get placement () {
let { placement } = this.props
if (this.rtl) {
placement = mirrorHorizontalPlacement(placement, ' ')
}
return !this.shown && this.props.shouldRenderOffscreen
? 'offscreen'
: placement
}
get trayPlacement () {
const { placement } = this.trayProps
return this.rtl ? mirrorHorizontalPlacement(placement, ' ') : placement
}