blob: c1efa76509bd6913e7a01ae28c7e04174c86a1b0 (
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
|
/**
* Marquees i.e. for Zohra
*/
import React, { Component } from 'react'
import Marquee from "react-smooth-marquee"
import "./marquee.css"
import { MARQUEES } from "site/projects/museum/constants"
export default class MarqueeContainer extends Component {
constructor(props) {
super(props)
this.state = {
}
}
componentDidMount() {
this.load()
}
componentDidUpdate(prevProps) {
if (this.props.location.pathname !== prevProps.location.pathname) {
this.load()
}
}
load() {
const { match } = this.props
const { page_name } = match.params
if (!(page_name in MARQUEES)) {
this.setState({ message: null })
}
this.setState({ message: MARQUEES[page_name] })
}
render() {
const { language } = this.props
if (!this.state.message) return null
return (
<div className="marquee-container">
<Marquee>
<span className="marquee-text">
{this.state.message[language]}
</span>
</Marquee>
</div>
)
}
}
/*
<Marquee
direction="left"
speed={112}
gradient={false}
>
<span className="marquee-text">
{this.state.message[language]}
</span>
</Marquee>
*/
|