From 7f561ec034faf36c4fe7d8a463a6ebdffc16539f Mon Sep 17 00:00:00 2001 From: jxmoose Date: Wed, 10 Apr 2024 00:50:44 -0700 Subject: [PATCH] design changes + adding active state to buttons --- src/app/exhibitsPage/page.tsx | 35 ++++------------ .../userComponents/BackButton/page.tsx | 18 +++++++-- .../userComponents/Exhibit/Exhibit.tsx | 40 ++----------------- 3 files changed, 26 insertions(+), 67 deletions(-) diff --git a/src/app/exhibitsPage/page.tsx b/src/app/exhibitsPage/page.tsx index a8625104..363693e0 100644 --- a/src/app/exhibitsPage/page.tsx +++ b/src/app/exhibitsPage/page.tsx @@ -3,32 +3,12 @@ import React, { useEffect, useState } from 'react'; import Link from 'next/link'; -import { IoIosArrowRoundBack } from 'react-icons/io'; import NavBar from '../../components/userComponents/navBar/navBar'; import { ExhibitRow } from '../../types/types'; import { fetchAllExhibits } from '../../supabase/exhibits/queries'; import Exhibit from '../../components/userComponents/Exhibit/Exhibit'; +import BackButton from '../../components/userComponents/BackButton/page'; -/** - * @param evt on click of button - */ -function goBack(evt : React.SyntheticEvent) { - // ignore the native anchor action - evt.preventDefault(); - window.history.back(); -} - -/** - * @returns back button - */ -function BackButton() { - return ( - - ); -} /** * @returns exhibit page @@ -53,7 +33,8 @@ function App() { const yOffset = -50; const y = element.getBoundingClientRect().top + window.scrollY + yOffset; - window.scrollTo({ top: y, behavior: 'smooth' }); + // check on this offset later + window.scrollTo({ top: y, behavior: 'instant' }); }, 1000); } }, []); @@ -62,11 +43,11 @@ function App() {
-
-
+
+
Our Exhibits{' '}
-
+
Saratoga is home to an abundance of plant and animal life. As you explore these exhibits you will learn about species that are endangered and being carefully monitored by scientists with @@ -74,8 +55,8 @@ function App() {
-
-
+
+
Go to Map
diff --git a/src/components/userComponents/BackButton/page.tsx b/src/components/userComponents/BackButton/page.tsx index 111f459a..1727e9a8 100644 --- a/src/components/userComponents/BackButton/page.tsx +++ b/src/components/userComponents/BackButton/page.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import { IoIosArrowRoundBack } from 'react-icons/io'; /** * @param evt on click of button @@ -16,9 +15,22 @@ function goBack(evt: React.SyntheticEvent) { */ export default function BackButton() { return ( - ); } diff --git a/src/components/userComponents/Exhibit/Exhibit.tsx b/src/components/userComponents/Exhibit/Exhibit.tsx index 630d5981..19159520 100644 --- a/src/components/userComponents/Exhibit/Exhibit.tsx +++ b/src/components/userComponents/Exhibit/Exhibit.tsx @@ -1,45 +1,11 @@ import React from 'react'; import Image from 'next/image'; - -/** - * - * @param root0 passed in - * @param root0.title title of exhibit - * @param root0.description description of exhibit - * @param root0.category category of exhibit - * @param root0.image image - * @param root0.id id of exhibit - * @returns exhibit component - */ - -/** - * @param evt on click of button - */ -function goBack(evt: React.SyntheticEvent) { - // ignore the native anchor action - evt.preventDefault(); - - window.history.back(); - } - - /** - * @returns back button - */ - function BackButton() { - return ( - - ); - } /** * * @param root0 passed in * @param root0.title title of exhibit * @param root0.description description of exhibit - * @param root0.category category of exhibit * @param root0.image image * @param root0.id id of exhibit * @returns exhibit component @@ -57,15 +23,15 @@ export default function Exhibit({ }) { return (
  • -
    +
    -

    +

    {' '} {title}

    -

    +

    {description}

    Exhibit