summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/editor/footnotes
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/app/views/editor/footnotes')
-rw-r--r--animism-align/frontend/app/views/editor/footnotes/components/footnote.form.js19
-rw-r--r--animism-align/frontend/app/views/editor/footnotes/footnotes.container.js39
-rw-r--r--animism-align/frontend/app/views/editor/footnotes/footnotes.css16
3 files changed, 74 insertions, 0 deletions
diff --git a/animism-align/frontend/app/views/editor/footnotes/components/footnote.form.js b/animism-align/frontend/app/views/editor/footnotes/components/footnote.form.js
new file mode 100644
index 0000000..3cd909d
--- /dev/null
+++ b/animism-align/frontend/app/views/editor/footnotes/components/footnote.form.js
@@ -0,0 +1,19 @@
+import React, { Component } from 'react'
+
+export default class FootnoteForm extends Component {
+ state = {
+ editing: false,
+ }
+
+ render() {
+ const { footnote, index } = this.props
+ return (
+ <div className='footnote-form'>
+ <div className='footnote-index'>
+ {index}{'. '}
+ </div>
+ <div className='footnote-text' dangerouslySetInnerHTML={{ __html: footnote.text }} />
+ </div>
+ )
+ }
+}
diff --git a/animism-align/frontend/app/views/editor/footnotes/footnotes.container.js b/animism-align/frontend/app/views/editor/footnotes/footnotes.container.js
new file mode 100644
index 0000000..d17f2eb
--- /dev/null
+++ b/animism-align/frontend/app/views/editor/footnotes/footnotes.container.js
@@ -0,0 +1,39 @@
+import React, { Component } from 'react'
+import { connect } from 'react-redux'
+
+import './footnotes.css'
+
+import FootnoteForm from './components/footnote.form'
+
+class FootnotesContainer extends Component {
+ render() {
+ const { annotation } = this.props
+ const { order, lookup } = annotation
+ const footnote_ids = order.filter(id => lookup[id].type === 'footnote')
+
+ return (
+ <div className='overview'>
+ <div className='project-top'>
+ <div className='project-heading'>
+ <h2>Footnotes</h2>
+ </div>
+ {footnote_ids.map((footnote_id, index) => (
+ <FootnoteForm
+ key={footnote_id}
+ footnote={lookup[footnote_id]}
+ index={index + 1}
+ />
+ ))}
+ </div>
+ </div>
+ )
+ }
+}
+
+const mapStateToProps = state => ({
+ project: state.site.project,
+ episode: state.site.episode,
+ annotation: state.annotation.index,
+})
+
+export default connect(mapStateToProps)(FootnotesContainer)
diff --git a/animism-align/frontend/app/views/editor/footnotes/footnotes.css b/animism-align/frontend/app/views/editor/footnotes/footnotes.css
new file mode 100644
index 0000000..e7eb790
--- /dev/null
+++ b/animism-align/frontend/app/views/editor/footnotes/footnotes.css
@@ -0,0 +1,16 @@
+.footnote-form {
+ display: flex;
+ justify-content: flex-start;
+ align-items: flex-start;
+}
+.footnote-index {
+ width: 80px;
+ text-align: right;
+ margin: 0;
+ padding: 0 1rem 0 0;
+}
+.footnote-text {
+ padding: 0 0 0.5rem 0;
+ flex: 1;
+ max-width: 500px;
+}