blob: ead2591a33971d98747a21f26ba24b13008fc4e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import React from 'react'
import { CURTAIN_COLOR_LOOKUP } from 'app/constants'
export const FullscreenImage = ({ element, media, transitionDuration }) => {
const color = element.color || CURTAIN_COLOR_LOOKUP.white
const item = media.lookup[element.settings.media_id]
const style = {
backgroundColor: color.backgroundColor,
color: color.textColor,
transitionDuration,
}
let url;
if (item.type === 'gallery' && item.settings.display_lookup[element.annotation.settings.frame_index]) {
url = item.settings.display_lookup[element.annotation.settings.frame_index].url
} else {
url = item.settings.display.url
}
return (
<div
className='fullscreen-element image'
style={style}
>
<div style={{
backgroundImage: 'url(' + url + ')',
}} />
</div>
)
}
|