How to use the @instructure/ui-react-utils.callRenderProp function in @instructure/ui-react-utils

To help you get started, we’ve selected a few @instructure/ui-react-utils 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-text-input / src / TextInput / index.js View on Github external
}
                

                  {/*
                    The input and content after input should not wrap, so they're in their own
                    Flex container
                  */}
                  
                    
                      {this.renderInput()}
                    
                    {(renderAfterInput || icon) &&
                      
                        {renderAfterInput ?
                          callRenderProp(renderAfterInput) :
                          callRenderProp(icon)
                        }
                      
                    }
                  

                
              

              /* If no prepended or appended content, don't render Flex layout */
              : this.renderInput()
          }
        
      
    )
  }
github instructure / instructure-ui / packages / ui-calendar / src / Calendar / index.js View on Github external
const nextButton = callRenderProp(renderNextMonthButton)
    const prevButton = callRenderProp(renderPrevMonthButton)

    const cloneButton = (button, onClick) => safeCloneElement(button, {
      onClick: createChainedFunction(button.props.onClick, onClick)
    })

    const classes = classnames({
      [styles.navigation]: true,
      [styles.withNavigationButtons]: prevButton || nextButton
    })

    return (
      <div>
        {prevButton &amp;&amp; cloneButton(prevButton, onRequestRenderPrevMonth)}
        {callRenderProp(renderNavigationLabel)}
        {nextButton &amp;&amp; cloneButton(nextButton, onRequestRenderNextMonth)}
      </div>
    )
  }
github instructure / instructure-ui / packages / ui-popover / src / Popover / index.js View on Github external
renderContent () {
    let content = ComponentIdentifier.pick(Popover.Content, this.props.children)
    if (!content) {
      content = callRenderProp(this.props.children)
    }

    if (this.shown) {
      content = (
        <dialog label="{this.props.screenReaderLabel" open="{this.shown}"> this._dialog = el}
          display="block"
          onBlur={this.handleDialogBlur}
          onDismiss={this.handleDialogDismiss}
          liveRegion={this.props.liveRegion}
          defaultFocusElement={this.props.defaultFocusElement}
          shouldContainFocus={this.props.shouldContainFocus}
          shouldReturnFocus={this.props.shouldReturnFocus}
          shouldFocusOnOpen={!this.props.shouldFocusContentOnTriggerBlur}</dialog>
github instructure / instructure-ui / packages / ui-calendar / src / Calendar / index.js View on Github external
renderHeader () {
    const {
      renderNextMonthButton,
      renderPrevMonthButton,
      renderNavigationLabel,
      onRequestRenderNextMonth,
      onRequestRenderPrevMonth
    } = this.props

    const nextButton = callRenderProp(renderNextMonthButton)
    const prevButton = callRenderProp(renderPrevMonthButton)

    const cloneButton = (button, onClick) =&gt; safeCloneElement(button, {
      onClick: createChainedFunction(button.props.onClick, onClick)
    })

    const classes = classnames({
      [styles.navigation]: true,
      [styles.withNavigationButtons]: prevButton || nextButton
    })

    return (
      <div>
        {prevButton &amp;&amp; cloneButton(prevButton, onRequestRenderPrevMonth)}
        {callRenderProp(renderNavigationLabel)}
        {nextButton &amp;&amp; cloneButton(nextButton, onRequestRenderNextMonth)}
      </div>
github instructure / instructure-ui / packages / ui-calendar / src / Calendar / Day / index.js View on Github external
borderColor="transparent"
        background="transparent"
        cursor={elementType === 'button' || elementType === 'a'
          ? (isDisabled ? 'not-allowed' : 'pointer')
          : 'auto'
        }
        disabled={isDisabled}
        aria-current={isToday ? 'date' : null}
        aria-selected={this.shouldApplyAriaSelected() ? (isSelected ? 'true' : 'false') : null}
        onClick={onClick &amp;&amp; this.handleClick}
        onKeyDown={onKeyDown &amp;&amp; this.handleKeyDown}
        elementRef={this.handleElementRef}
      &gt;
        <span>
          
            {callRenderProp(children)}
          
        </span>
      
    )
  }
}
github instructure / instructure-ui / packages / ui-number-input / src / NumberInput / index.js View on Github external
interaction,
      inline,
      display,
      placeholder,
      required,
      isRequired,
      showArrows,
      size,
      value,
      width
    } = this.props

    return (
      
        <span width="" style="{width">
          </span>
github instructure / instructure-ui / packages / ui-calendar / src / Calendar / index.js View on Github external
const nextButton = callRenderProp(renderNextMonthButton)
    const prevButton = callRenderProp(renderPrevMonthButton)

    const cloneButton = (button, onClick) =&gt; safeCloneElement(button, {
      onClick: createChainedFunction(button.props.onClick, onClick)
    })

    const classes = classnames({
      [styles.navigation]: true,
      [styles.withNavigationButtons]: prevButton || nextButton
    })

    return (
      <div>
        {prevButton &amp;&amp; cloneButton(prevButton, onRequestRenderPrevMonth)}
        {callRenderProp(renderNavigationLabel)}
        {nextButton &amp;&amp; cloneButton(nextButton, onRequestRenderNextMonth)}
      </div>
    )
  }
github instructure / instructure-ui / packages / ui-alerts / src / Alert / index.js View on Github external
renderCloseButton () {
    const closeButtonLabel = (this.props.renderCloseButtonLabel
      &amp;&amp; callRenderProp(this.props.renderCloseButtonLabel))
      || this.props.closeButtonLabel

    return closeButtonLabel
      ? <div>
        
          {closeButtonLabel}
        
      </div>
      : null
  }
github instructure / instructure-ui / packages / ui-navigation / src / AppNav / Item / index.js View on Github external
render () {
    const ElementType = getElementType(Item, this.props)

    const {
      renderIcon,
      renderLabel,
      href,
      isSelected,
      elementRef,
      renderAfter,
      cursor,
      isDisabled
    } = this.props

    const icon = callRenderProp(renderIcon)
    const label = callRenderProp(renderLabel)

    const labelIsForScreenReaders = matchComponentTypes(
      label, [ScreenReaderContent]
    )

    if (icon) {
      error(
        labelIsForScreenReaders,
        '[AppNav] If an icon is used, the label text should be wrapped in .'
      )
    }

    const classes = classnames ({
      [styles.root]: true,
      [styles.isSelected]: isSelected,
      [styles.disabled]: isDisabled