summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/viewer/player/components.inline/inline.utility.js
blob: 0ffcd7cc6b74dc2d9df2f064d31970b781eaa031 (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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 }) => {
  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 CreditsComponent = ({ episodes, venues }) => {
  const currentEpisode = episodes.lookup[episodes.order[0]].settings
  const lines = currentEpisode.credits.split("\n").map((s, i) => {
    if (s[0] === "#") {
      return (
        <div className='credits-title' key={i}>
          {s.replace("#", "").trim()}
        </div>
      )
    }
    return (
      <div
        key={i}
        dangerouslySetInnerHTML={{ __html: s || " " }}
      />
    )
  })
  return (
    <div className='site-credits'>
      {lines}
    </div>
  )
}

const CreditsVenue = ({ venue }) => {
  return (
    <div />
  )
}

export const SubscriptionForm = () => {
  return (
    <div className="subscription-form">
      Stay up to date and get notified when the next episode is available
      <input type="text" placeholder="Email address here" />
    </div>
  )
}

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

export const Schedule = connect(mapStateToProps)(ScheduleComponent)
export const Credits = connect(mapStateToProps)(CreditsComponent)