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:
parent
5d2c3db90a
commit
9ad67e8cd6
@ -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>
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user