Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
import React, { SyntheticEvent } from 'react'
import { isFunction } from 'exotic'
import { wording } from '@skava/ui/dist/words'
import { ShippingAddress } from '@skava/ui/dist/forms/views'
import { SingleShippingProps } from './typings'
import { StyledPrimaryButton } from './styled'

function defaultRenderButton(props: SingleShippingProps) {
  const { onShipToMultipleAddress } = props

  const handleClick = (event: SyntheticEvent<HTMLButtonElement>) => {
    console.log('[onShipToMultipleAddress]', event)
    if (isFunction(onShipToMultipleAddress)) {
      onShipToMultipleAddress(event)
    }
  }

  return (
    <StyledPrimaryButton
      text={wording.multipleAddressText}
      onClick={handleClick}
    />
  )
}

function defaultRenderForm(props: SingleShippingProps) {
  return <ShippingAddress {...props} />
}

export { defaultRenderButton, defaultRenderForm }