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