1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2025-01-05 11:25:00 +01:00

shorter render function

This commit is contained in:
Matthias Kretschmann 2019-03-29 23:03:21 +01:00
parent 5d2c3db90a
commit 9ad67e8cd6
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -29,21 +29,15 @@ export default class Availability extends PureComponent {
render={data => { render={data => {
const { availability } = data.dataYaml const { availability } = data.dataYaml
const { status, available, unavailable } = availability const { status, available, unavailable } = availability
const className = status
? `${styles.availability} ${styles.available}`
: `${styles.availability}`
const html = status ? available : unavailable
return ( return (
!this.props.hide && ( !this.props.hide && (
<Animation <Animation className={className}>
className={ <p dangerouslySetInnerHTML={{ __html: html }} />
status
? `${styles.availability} ${styles.available}`
: `${styles.availability}`
}
>
<p
dangerouslySetInnerHTML={{
__html: status ? available : unavailable
}}
/>
</Animation> </Animation>
) )
) )