How to use the @instructure/ui-position.mirrorHorizontalPlacement function in @instructure/ui-position

To help you get started, we’ve selected a few @instructure/ui-position examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github instructure / instructure-ui / packages / ui-popover / src / Popover / index.js View on Github external
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 {
github instructure / instructure-ui / packages / ui-popover / src / Popover / index.js View on Github external
get placement () {
    let { placement } = this.props

    if (this.rtl) {
      placement = mirrorHorizontalPlacement(placement, ' ')
    }

    return !this.shown && this.props.shouldRenderOffscreen
      ? 'offscreen'
      : placement
  }
github instructure / instructure-ui / packages / ui-drawer-layout / src / DrawerLayout / index.js View on Github external
get trayPlacement () {
    const { placement } = this.trayProps
    return this.rtl ? mirrorHorizontalPlacement(placement, ' ') : placement
  }