summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/components.inline/inline.utility.js
blob: 486b8e5b170da95f447781dec3035706c81e47b8 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
import React, { Component } from 'react'
import { connect } from 'react-redux'

import { MediaCitation } from '../components.media'

export const Intro = ({ paragraph, media, onAnnotationClick }) => {
  const annotation = paragraph.annotations[0]
  const item = media.lookup[annotation.settings.media_id]
  // console.log(item)
  const style = {
    backgroundImage: 'url(' + item.settings.file.url + ')',
  }
  let lines = []
  if (annotation.settings.title) {
    lines = lines.concat(annotation.settings.title.split(/<br[^>]*>/))
  }
  if (annotation.settings.subtitle) {
    lines = lines.concat(annotation.settings.subtitle.split(/<br[^>]*>/))
  }
  return (
    <div>
      <div
        className='site-intro'
        style={style}
      >
        <div className='inner'>
          {lines.map((line, i) => (
            <span key={i} dangerouslySetInnerHTML={{ __html: line }} />
          ))}
        </div>
      </div>
      <div className='media intro'>
        <MediaCitation media={item} />
      </div>
    </div>
  )
}

const ScheduleComponent = ({ episodes, venues }) => {
  console.log(episodes.lookup[episodes.order[0]])
  const currentEpisode = episodes.lookup[episodes.order[0]].settings
  return (
    <div>
      <div className="schedule-about">
        {'Animism on e-flux.com is the ninth iteration of the exhibition and overall '}
        {'research project presented at Extra City and MuHKA, Antwerp, 2010; Kunsthalle '}
        {'Bern, 2010; Generali Foundation, Vienna, 2011; the Haus der Kulturen der Welt, '}
        {'Berlin, 2012; e-flux, New York, 2012; OCAT Shenzhen, 2013; Times Museum Seoul, '}
        {'2013; and Ashkal Alwan, Beirut, 2014. Presented here in its digital iteration, '}
        {'the exhibition will be released in four episodes starting October 2020.'}
      </div>
      <div className='schedule'>
        <div className='schedule-title'>Schedule</div>
        {episodes.order.map(id => {
          const episode = episodes.lookup[id]
          return (
            <div className={episode.is_live ? 'schedule-row active' : 'schedule-row inactive'} key={episode.id}>
              <div className='schedule-date'>
                {episode.release_date}
              </div>
              <div className='schedule-title'>
                {'Episode '}{episode.episode_number}{': '}
                <i>{episode.title}</i>
              </div>
            </div>
          )
        })}
      </div>
      <div className='credits'>
        <div>
          <div className='credits-title'>
            Curator
          </div>
          <div className='credits-info'>
            {currentEpisode.curator}
          </div>
        </div>
        <div>
          <div className='credits-title'>
            Author
          </div>
          <div className='credits-info'>
            {currentEpisode.author}
          </div>
        </div>
        <div>
          <div className='credits-title'>
            Artists
          </div>
          <div className='credits-info'>
            {currentEpisode.artists}
          </div>
        </div>
      </div>
    </div>
  )
}

const mapStateToProps = state => ({
  episodes: state.episode.index,
  episode: state.episode.show.res || {},
  venues: state.venue.index,
})

export const Schedule = connect(mapStateToProps)(ScheduleComponent)