From d1c89b9908a94e40a08148c2849d40fe0508c4cc Mon Sep 17 00:00:00 2001 From: Patrick Lienau Date: Mon, 6 May 2024 15:49:50 -0500 Subject: [PATCH] Reformat to 2-space indents --- demo/app.js | 342 ++++++++++++++++++++++++++-------------------------- 1 file changed, 171 insertions(+), 171 deletions(-) diff --git a/demo/app.js b/demo/app.js index dfc1fddd..a472a972 100644 --- a/demo/app.js +++ b/demo/app.js @@ -13,191 +13,191 @@ import MarkersDisplay from '@Components/MarkersDisplay/MarkersDisplay'; import './app.scss'; const App = ({ manifestURL }) => { - const [userURL, setUserURL] = React.useState(manifestURL); - const [manifestUrl, setManifestUrl] = React.useState(manifestURL); - - const tabValues = [ - { title: 'Details', ref: React.useRef(null) }, - { title: 'Transcripts', ref: React.useRef(null) }, - { title: 'Files', ref: React.useRef(null) }, - { title: 'Markers', ref: React.useRef(null) }, - ]; - - React.useEffect(() => { - setManifestUrl(manifestUrl); - }, [manifestUrl]); - - const handleSubmit = (e) => { - e.preventDefault(); - setManifestUrl(userURL); - }; - - const handleUserInput = (e) => { - setManifestUrl(); - setUserURL(e.target.value); - }; - - return ( -
-
-

Ramp

-

An interactive, IIIF powered A/V player built with components - from - @samvera/ramp - library. This player supports IIIF Presentation 3.0 Manifests. Please enter the URL - of your public manifest to view it in the player. -

-
-
-
-
- -
-
- - -
-
-
-
-
-
- -
- -
-
- - -
- -
-
-
+ const [userURL, setUserURL] = React.useState(manifestURL); + const [manifestUrl, setManifestUrl] = React.useState(manifestURL); + + const tabValues = [ + { title: 'Details', ref: React.useRef(null) }, + { title: 'Transcripts', ref: React.useRef(null) }, + { title: 'Files', ref: React.useRef(null) }, + { title: 'Markers', ref: React.useRef(null) }, + ]; + + React.useEffect(() => { + setManifestUrl(manifestUrl); + }, [manifestUrl]); + + const handleSubmit = (e) => { + e.preventDefault(); + setManifestUrl(userURL); + }; + + const handleUserInput = (e) => { + setManifestUrl(); + setUserURL(e.target.value); + }; + + return ( +
+
+

Ramp

+

An interactive, IIIF powered A/V player built with components + from + @samvera/ramp + library. This player supports IIIF Presentation 3.0 Manifests. Please enter the URL + of your public manifest to view it in the player. +

+
+
+
+
+ +
+
+ + +
+
- ); +
+
+ +
+ +
+
+ + +
+ +
+
+
+
+
+ ); }; /*Reference: https://accessible-react.eevis.codes/components/tabs */ const Tabs = ({ tabValues, manifestUrl }) => { - const [activeTab, setActiveTab] = React.useState(0); - - let tabs = []; - - const handleClick = (index) => { - setActiveTab(index); - }; - - const handleNextTab = (firstTabInRound, nextTab, lastTabInRound) => { - const tabToSelect = - activeTab === lastTabInRound ? firstTabInRound : nextTab; - setActiveTab(tabToSelect); - tabValues[tabToSelect].ref.current.focus(); - }; - - const handleKeyPress = (event) => { - const tabCount = Object.keys(tabValues).length - 1; - - if (event.key === "ArrowLeft") { - const last = tabCount; - const next = activeTab - 1; - handleNextTab(last, next, 0); - } - if (event.key === "ArrowRight") { - const first = 0; - const next = activeTab + 1; - handleNextTab(first, next, tabCount); - } - }; - - tabValues.map((t, index) => { - tabs.push( - - ); - }); - - return ( -
-
-
    - {tabs} -
-
- - - - - - - - - - - - -
+ const [activeTab, setActiveTab] = React.useState(0); + + let tabs = []; + + const handleClick = (index) => { + setActiveTab(index); + }; + + const handleNextTab = (firstTabInRound, nextTab, lastTabInRound) => { + const tabToSelect = + activeTab === lastTabInRound ? firstTabInRound : nextTab; + setActiveTab(tabToSelect); + tabValues[tabToSelect].ref.current.focus(); + }; + + const handleKeyPress = (event) => { + const tabCount = Object.keys(tabValues).length - 1; + + if (event.key === "ArrowLeft") { + const last = tabCount; + const next = activeTab - 1; + handleNextTab(last, next, 0); + } + if (event.key === "ArrowRight") { + const first = 0; + const next = activeTab + 1; + handleNextTab(first, next, tabCount); + } + }; + + tabValues.map((t, index) => { + tabs.push( + ); + }); + + return ( +
+
+
    + {tabs} +
+
+ + + + + + + + + + + + +
+ ); }; const Tab = ({ id, tabPanelId, index, handleChange, activeTab, title, tabRef }) => { - const handleClick = () => { handleChange(index); }; - return ( -
  • - -
  • - ); + const handleClick = () => { handleChange(index); }; + return ( +
  • + +
  • + ); }; const TabPanel = ({ id, tabId, activeTab, tabIndex, children }) => { - return ( - - ); + return ( + + ); }; export default App;