From c285798ec48118ed157bd90a7b088d78d089d5cc Mon Sep 17 00:00:00 2001 From: jxmoose Date: Sun, 28 Apr 2024 13:18:29 -0700 Subject: [PATCH] some wbe changes --- src/app/exhibitsPage/page.tsx | 129 +++++++++++++++++++++++++--------- 1 file changed, 95 insertions(+), 34 deletions(-) diff --git a/src/app/exhibitsPage/page.tsx b/src/app/exhibitsPage/page.tsx index 1dec7631..d69f2aa6 100644 --- a/src/app/exhibitsPage/page.tsx +++ b/src/app/exhibitsPage/page.tsx @@ -24,6 +24,16 @@ function App() { // Detect the hash in URL and scroll to the element with the corresponding ID }, [exhibits]); + // for web rendering + const [windowWidth, setWindowWidth] = useState(1024); + useEffect(() => { + const handleResize = () => setWindowWidth(window.innerWidth); + window.addEventListener('resize', handleResize); + return () => { + window.removeEventListener('resize', handleResize); + }; + }, []); + // activates whenever the page opens. // checks if there's a "hash" which is an id of one of the exhibits to scroll to. // scrolls down to corresponding exhibit with slight offset @@ -43,43 +53,94 @@ function App() { } }, []); return ( -
- -
- -
-

- Our Exhibits{' '} -

-

- The Bay Area is home to a wide variety of plant and animal life. As - you explore the exhibits, you will learn about threatened and - endangered species that are under careful monitoring by biologists. - Protective conservation efforts are in place for these vulnerable - plants and animals. We welcome you to learn more about these - important species throughout the exhibits. Scan the QR codes on - display for more information. -

+
+ {windowWidth < 1024 && ( +
+ +
+ +
+

+ Our Exhibits{' '} +

+

+ The Bay Area is home to a wide variety of plant and animal life. + As you explore the exhibits, you will learn about threatened and + endangered species that are under careful monitoring by + biologists. Protective conservation efforts are in place for + these vulnerable plants and animals. We welcome you to learn + more about these important species throughout the exhibits. Scan + the QR codes on display for more information. +

+
+ +
+

+ Go to Map +

+
+ +
    + {exhibits.map(exhibit => ( + + ))} +
+
- -
-

- Go to Map + )} + {windowWidth >= 1024 && ( +

+ +
+

+ {' '} + + {' '} + Home{' '} + {' '} + / Our Exhibits{' '}

+
+

+ Our Exhibits{' '} +

+

+ The Bay Area is home to a wide variety of plant and animal life. + As you explore the exhibits, you will learn about threatened and + endangered species that are under careful monitoring by + biologists. Protective conservation efforts are in place for + these vulnerable plants and animals. We welcome you to learn + more about these important species throughout the exhibits. Scan + the QR codes on display for more information. +

+
+ +
+

+ Go to Map +

+
+ +
    + {exhibits.map(exhibit => ( + + ))} +
- -
    - {exhibits.map(exhibit => ( - - ))} -
-
+
+ )}
); }