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    
ui-component-library / src / components / organisms / Footer / renderProps.tsx
Size: Mime:
import React from 'react'
import { isSafe } from 'exotic'
import { LogoIcon } from 'atoms/Icons/LogoIcon'
import { FooterProps } from './typings'
import {
  StyledMobilePoweredByLabel,
  StyledMobilePoweredByValue,
  StyledPoweredByLabel,
  StyledPoweredByValue,
  StyledCopyRight,
  StyledMultipleLinkList,
  StyledLabel,
  StyledSocialIconList,
} from './styled'

function defaultRenderLogo(props: FooterProps) {
  const { logoType, logoColor, logoIcon } = props
  const qa = (logoIcon && logoIcon.dataQa) ? logoIcon.dataQa : ''

  if (isSafe(logoType) && isSafe(logoColor)) {
    return <LogoIcon type={logoType} fill={logoColor} dataQa={qa}/>
  }
}

function defaultRenderMobilePoweredBy(props: FooterProps) {
  const { poweredByData } = props
  const label = poweredByData && poweredByData.label
  const value = poweredByData && poweredByData.value
  return (
    <React.Fragment>
      <StyledMobilePoweredByLabel content={label} />
      <StyledMobilePoweredByValue content={value} />
    </React.Fragment>
  )
}

function defaultRenderPoweredByLabel(props: FooterProps) {
  const { poweredByData } = props
  const label = poweredByData && poweredByData.label
  return <StyledPoweredByLabel content={label} />
}

function defaultRenderPoweredByValue(props: FooterProps) {
  const { poweredByData } = props
  const value = poweredByData && poweredByData.value
  return <StyledPoweredByValue content={value} />
}

function defaultRenderCopyright(props: FooterProps) {
  const { copyrightData } = props
  return <StyledCopyRight {...copyrightData} />
}

function defaultRenderSocialIconLabel(props: FooterProps) {
  const { connectText } = props
  return <StyledLabel content={connectText} />
}

function defaultRenderSocialIcons(props: FooterProps) {
  const { listOfSocialIcons } = props
  return <StyledSocialIconList iconsList={listOfSocialIcons} />
}

function defaultRenderLinkList(props: FooterProps) {
  const { listOfLinks } = props
  return <StyledMultipleLinkList list={listOfLinks} />
}

export {
  defaultRenderLogo,
  defaultRenderMobilePoweredBy,
  defaultRenderPoweredByLabel,
  defaultRenderPoweredByValue,
  defaultRenderCopyright,
  defaultRenderSocialIcons,
  defaultRenderLinkList,
  defaultRenderSocialIconLabel,
}