summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/components.inline/inline.gallery.js
blob: f113abfde0b16c706ea1f55d15cf020c40ccf33c (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
 import React from 'react'

import { CURTAIN_COLOR_LOOKUP } from 'app/constants'
import { MediaCitation, Vitrine, Gallery, Carousel, Grid } from '../components.media'

export const InlineVitrine = ({ paragraph, media, currentSection, onAnnotationClick }) => {
  const annotation = paragraph.annotations[0]
  const mediaItem = media.lookup[annotation.settings.media_id]
  const color = CURTAIN_COLOR_LOOKUP[annotation.settings.color] || CURTAIN_COLOR_LOOKUP.white
  const style = {
    backgroundColor: color.backgroundColor,
    color: color.textColor,
  }
  return (
    <div
      className={'inline-element media vitrine ' + color.name}
      style={style}
    >
      {annotation.settings.title && <div className='heading'>{annotation.settings.title}</div>}
      <Vitrine media={mediaItem} color={color} />
    </div>
  )
  // <MediaCitation media={mediaItem} />
}

export const InlineGallery = ({ paragraph, media, currentSection, onAnnotationClick }) => {
  const annotation = paragraph.annotations[0]
  const mediaItem = media.lookup[annotation.settings.media_id]
  return (
    <div
      className='inline-element media gallery'
    >
      <Gallery media={mediaItem} annotation={annotation} />
    </div>
  )
}

export const InlineCarousel = ({ paragraph, media, currentSection, onAnnotationClick }) => {
  const annotation = paragraph.annotations[0]
  const mediaItem = media.lookup[annotation.settings.media_id]
  const color = CURTAIN_COLOR_LOOKUP[annotation.settings.color] || CURTAIN_COLOR_LOOKUP.white
  const style = {
    backgroundColor: color.backgroundColor,
    color: color.textColor,
  }
  return (
    <div
      className={'inline-element media carousel ' + color.label}
    >
      <div style={style} className='carousel-container'>
        <Carousel
          media={mediaItem}
          cues={currentSection.mediaCues[mediaItem.id]}
        />
      </div>
    </div>
  )
}

export const InlineGrid = ({ paragraph, media, currentSection, onAnnotationClick }) => {
  const annotation = paragraph.annotations[0]
  const mediaItem = media.lookup[annotation.settings.media_id]
  return (
    <div
      className='inline-element media grid'
    >
      <Grid media={mediaItem} annotation={annotation} />
    </div>
  )
}

// <MediaCitation media={mediaItem} />