From ac03ba9a645066acfda0449a879034531bb6cee3 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 10 Oct 2020 01:41:04 +0200 Subject: moving checklist section to credits thingie --- .../views/viewer/checklist/checklist.container.js | 21 +++++++++++---------- .../app/views/viewer/checklist/checklist.content.js | 4 ++-- .../views/viewer/checklist/checklist.dropdown.js | 4 ++-- 3 files changed, 15 insertions(+), 14 deletions(-) (limited to 'animism-align/frontend/app/views/viewer/checklist') diff --git a/animism-align/frontend/app/views/viewer/checklist/checklist.container.js b/animism-align/frontend/app/views/viewer/checklist/checklist.container.js index 7a8db0e..11310e7 100644 --- a/animism-align/frontend/app/views/viewer/checklist/checklist.container.js +++ b/animism-align/frontend/app/views/viewer/checklist/checklist.container.js @@ -9,33 +9,34 @@ import CreditsContent from './credits.content' class Checklist extends Component { state = { - currentSection: 'all', + checklistSection: 'all', } constructor(props) { super(props) this.handleSectionChange = this.handleSectionChange.bind(this) } - handleSectionChange(currentSection) { - this.setState({ currentSection }) + handleSectionChange(checklistSection) { + this.setState({ checklistSection }) } render() { - const { currentSection } = this.state + const { viewer } = this.props + const { checklistSection } = this.state return (
- (viewer.checklist && ( + {viewer.checklist && (
- ) - (viewer.credits && ( + )} + {viewer.credits && ( - )) + )}
) } diff --git a/animism-align/frontend/app/views/viewer/checklist/checklist.content.js b/animism-align/frontend/app/views/viewer/checklist/checklist.content.js index 1406996..d0f115c 100644 --- a/animism-align/frontend/app/views/viewer/checklist/checklist.content.js +++ b/animism-align/frontend/app/views/viewer/checklist/checklist.content.js @@ -13,12 +13,12 @@ class ChecklistContent extends Component { } render() { - const { sections, currentSection } = this.props + const { sections, checklistSection } = this.props return (
{sections.map(section => { - if ((currentSection !== "all" && section.index !== currentSection) || !section.media.length) { + if ((checklistSection !== "all" && section.index !== checklistSection) || !section.media.length) { return
} return ( diff --git a/animism-align/frontend/app/views/viewer/checklist/checklist.dropdown.js b/animism-align/frontend/app/views/viewer/checklist/checklist.dropdown.js index 0ed2f0d..58695e0 100644 --- a/animism-align/frontend/app/views/viewer/checklist/checklist.dropdown.js +++ b/animism-align/frontend/app/views/viewer/checklist/checklist.dropdown.js @@ -17,13 +17,13 @@ class ChecklistDropdown extends Component { this.setState({ open: false }) } render() { - const { sections, currentSection } = this.props + const { sections, checklistSection } = this.props const { open } = this.state return (
this.handleOpen()}> - {currentSection === 'all' ? 'View All' : 'Section ' + ROMAN_NUMERALS[currentSection]} + {checklistSection === 'all' ? 'View All' : 'Section ' + ROMAN_NUMERALS[checklistSection]}
-- cgit v1.2.3-70-g09d2