Repository URL to install this package:
|
Version:
0.14.1 ▾
|
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,
}