1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2025-01-03 18:35: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 => {
const { availability } = data.dataYaml
const { status, available, unavailable } = availability
const className = status
? `${styles.availability} ${styles.available}`
: `${styles.availability}`
const html = status ? available : unavailable
return (
!this.props.hide && (
<Animation
className={
status
? `${styles.availability} ${styles.available}`
: `${styles.availability}`
}
>
<p
dangerouslySetInnerHTML={{
__html: status ? available : unavailable
}}
/>
<Animation className={className}>
<p dangerouslySetInnerHTML={{ __html: html }} />
</Animation>
)
)