diff --git a/src/components/Constitution.jsx b/src/components/Constitution.jsx index 74c9e36..e12a2cc 100644 --- a/src/components/Constitution.jsx +++ b/src/components/Constitution.jsx @@ -23,7 +23,7 @@ export default function Constitution({constitution, search = null}) {
-
diff --git a/src/components/Sections.jsx b/src/components/Sections.jsx index 334e727..a48267e 100644 --- a/src/components/Sections.jsx +++ b/src/components/Sections.jsx @@ -1,6 +1,7 @@ import React, { useState, useEffect } from 'react'; import accordionToggle from '../utils/accordion.js'; import highlight from '../utils/highlight.js'; +import toggleIssue from '../utils/toggleIssue.js'; import "../styles/Section.css"; import pdf from "../images/PDF_file_icon.svg"; import "../styles/Normal.css"; @@ -17,28 +18,17 @@ export default function Sections({ sections, search = null }) { }) }; - const [isTopicExpanded, setTopicIsExpanded] = useState(false); - const [isShown, setIsShown] = useState(false); - const sectionArr = sections.map((section, index) => (
-
+
+ { + evt.stopPropagation(); + }} target="_blank" rel="noreferrer"> + บันทึกการประชุม + + { section.ประเด็นการพิจารณา.length ? ( + { + evt.stopPropagation(); + evt.preventDefault(); + toggleIssue(index + 1); + }}> + ประเด็นการพิจารณา + + ) : false } +
+
{section.ร่างมาตรา ? (
@@ -100,32 +106,39 @@ export default function Sections({ sections, search = null }) {
-
) : ''} {section.ประเด็นการพิจารณา.length ? ( - <> -
-

ประเด็นการพิจารณา

-
-
-
-
-
-
- {isShown && - - } -
+
+
+

+ +

+

ประเด็นการพิจารณา

+
+

+ +

- +
) : ''}
diff --git a/src/styles/Home.css b/src/styles/Home.css index d943561..5cfbd9e 100644 --- a/src/styles/Home.css +++ b/src/styles/Home.css @@ -72,6 +72,17 @@ body { margin-bottom: 0em; } +.section-button a { + color: #feb; + background: #310; + border: 1px solid #cb6; + margin-right: 12px; + padding: 6px 14px 8px 14px; +} + .section-button a:last-child { + margin-right: 0px; + } + .provision p { text-indent: 3em; line-height: 2em; @@ -143,3 +154,7 @@ body { .react-paginate li.active a { color: #000; } + +.no-scroll { + overflow-y: hidden; +} diff --git a/src/utils/toggleIssue.js b/src/utils/toggleIssue.js new file mode 100644 index 0000000..703f186 --- /dev/null +++ b/src/utils/toggleIssue.js @@ -0,0 +1,11 @@ +export default function toggleIssue(issueNo) { + const elem = document.getElementById('issue-'+issueNo); + document.body.classList.toggle('no-scroll'); + elem.classList.toggle('hidden'); + elem.scrollTo(0, 0); + window.onhashchange = evt => { + document.body.classList.remove('no-scroll'); + window.onhashchange = ''; + }; + return; +}