Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const Paragraph: React.SFC = ({ intlKey, children, bold}) =>
{bold ? <b>{intlKey
? intl.getHTML(intlKey)
.defaultMessage(children)
: children
}</b> : intlKey
? intl.getHTML(intlKey)
.defaultMessage(children)
: children
}
render() {
return (
<div>
<div>Html Examples:</div>
<div>{intl.getHTML('TIP')}</div>
<div>{intl.getHTML('TIP_VAR', {message: 'HTML with variables'})}</div>
<div>{intl.getHTML('TIP_VAR', {message: ''})}</div>
</div>
)
}
}
render() {
return (
<div>
<div>Html Examples:</div>
<div>{intl.getHTML('TIP')}</div>
<div>{intl.getHTML('TIP_VAR', {message: 'HTML with variables'})}</div>
<div>{intl.getHTML('TIP_VAR', {message: ''})}</div>
</div>
)
}
}
export const IntlText: React.SFC> = ({ intlKey, children }) => {
return (
<>
{intl.getHTML(intlKey).defaultMessage(children as string | JSX.Element)}
)
}
export const Span: React.SFC = ({ intlKey, children, bold}) =>
{bold ? <b>{intlKey
? intl.getHTML(intlKey).defaultMessage(children)
: children
}</b> : intlKey
? intl.getHTML(intlKey).defaultMessage(children)
: children
}