Skip to content

Commit

Permalink
small post rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jxmoose committed May 22, 2024
1 parent bbe6f7f commit f6cdcf9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 28 deletions.
4 changes: 2 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import VisitorResources from '../components/userComponents/HomePageComponents/Vi
import WelcomeGraphic from '../components/userComponents/HomePageComponents/WelcomeGraphic/WelcomeGraphic';
import HomeVirtualTours from '../components/userComponents/HomePageComponents/HomeVirtualTours/HomeVirtualTours';
import HomeNewsFeed from '../components/userComponents/HomePageComponents/HomeNewsFeed/HomeNewsFeed';
import { useWebScreenDetection } from '../context/WindowWidthContext/WindowWidthContext';
import { useWebDeviceDetection } from '../context/WindowWidthContext/WindowWidthContext';

/**
* @returns - Home page for PHS/SPCA. Buttons are available for the major flows of the application from this page.
Expand All @@ -22,7 +22,7 @@ function Home() {
// window.removeEventListener('resize', handleResize);
// };
// }, []);
const isWebDevice = useWebScreenDetection();
const isWebDevice = useWebDeviceDetection();

return (
<div className="HomePage w-full h-full m-0 flex-col justify-center font-normal">
Expand Down
5 changes: 1 addition & 4 deletions src/components/userComponents/Exhibit/Exhibit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ export default function Exhibit({
description,
image,
id,
web,
}: {
title: string;
description: string;
image: string;
id: number;
web: boolean;
}) {
const isWebDevice = useWebDeviceDetection();
return (
Expand All @@ -34,7 +32,6 @@ export default function Exhibit({
<div className="flex-col justify-start items-start gap-5 flex">
<div className="justify-start items-center gap-2 inline-flex">
<h2 className="text-night font-semibold leading-tight font-['Lato']">
{' '}
{title}
</h2>
</div>
Expand All @@ -50,7 +47,7 @@ export default function Exhibit({
<div className="flex flex-col w-full px-8 py-16 bg-mint-cream rounded-lg flex-col justify-start items-start gap-2.5 mt-6">
<div className="justify-start items-start gap-5">
<div className="justify-start items-center gap-2">
<h1 className="text-hunterGreen font-semibold leading-tight font-['Lato']">
<h1 className="text-hunter-green font-semibold leading-tight font-['Lato']">
{' '}
{title}
</h1>
Expand Down
23 changes: 3 additions & 20 deletions src/components/userComponents/SiteMap/DisplayPreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Link from 'next/link';
import Image from 'next/image';
import { ExhibitWithCategoryRow, TourRow } from '../../../types/types';
import { fetchImagesForTour } from '../../../supabase/media/queries';
import { fetchExhibitImage } from '../../../supabase/exhibits/queries';
import { CloseIcon } from '../../../../public/icons';

interface DisplayCardProps {
tour: TourRow | ExhibitWithCategoryRow;
Expand Down Expand Up @@ -53,10 +55,8 @@ function DisplayPreviewCard({
const images = await fetchImagesForTour(tour.id);
if (images && images.length > 0) {
imageUrl = images[0].url;
imageUrl = images[0].url;
}
displayName = tour.name;
displayName = tour.name;
} else {
// Handle as an ExhibitWithCategoryRow
// const imageObj = await fetchExhibitImage(tour.id);
Expand All @@ -66,27 +66,18 @@ function DisplayPreviewCard({
displayName = tour.category;
}


// Set state variables
setPreviewImage(imageUrl);
setname1(displayName);
setLoading(false);
};


fetchDetails();
}, [tour]);


/** route this to spotlights */

return (
<div className="flex flex-col items-center justify-center w-[25rem] h-[8.25rem] max-w-xs sm:max-w-sm md:max-w-md lg:max-w-lg mx-auto p-4 pb-[2.87rem] pr-[1.19rem] pl-[1.19rem] rounded-md">
<div
className="flex flex-row items-center rounded-md overflow-hidden bg-ivory cursor-pointer w-full sm:w-4/4 md:w-5/5 lg:w-2/2 xl:w-5/5 flex-shrink-0 shadow-xl"
aria-hidden="true"
>
{!loading && (
<div className="flex flex-col items-center justify-center w-[25rem] h-[8.25rem] max-w-xs sm:max-w-sm md:max-w-md lg:max-w-lg mx-auto p-4 pb-[2.87rem] pr-[1.19rem] pl-[1.19rem] rounded-md">
<div
className="flex flex-row items-center rounded-md overflow-hidden bg-ivory cursor-pointer w-full sm:w-4/4 md:w-5/5 lg:w-2/2 xl:w-5/5 flex-shrink-0 shadow-xl"
Expand All @@ -97,7 +88,6 @@ function DisplayPreviewCard({
<Image
src={previewImage}
alt="placeholder"
alt="placeholder"
layout="fill"
objectFit="cover"
/>
Expand Down Expand Up @@ -133,28 +123,21 @@ function DisplayPreviewCard({
>
<CloseIcon />
</div>
<Link href={`/exhibitsPage/#a${id}`}>
<Link href={`/spotlightPage/${id}`}>
<h3 className="relative truncate text-asparagus pr-[0.31rem] pl-[0.75rem] pt-[0rem] uppercase font-light text-xs leading-normal">
{category}
</h3>
<h3 className="relative truncate font-medium font-lato text-night pr-[0.31rem] pl-[0.75rem] pt-[0.30rem] pb-[0rem] text-base leading-normal">
<h3 className="relative truncate font-medium font-lato text-night pr-[0.31rem] pl-[0.75rem] pt-[0.30rem] pb-[0rem] text-base leading-normal">
{name1}
</h3>


<h4 className="relative font-lato h-[2rem] pr-[0.31rem] pt-[0rem] pl-[0.75rem] pb-[2.4rem] text-shadow line-clamp-2 text-sm">
{description}
</h4>
</Link>
</div>
</div>
</div>
</div>
</Link>
</div>
</div>
</div>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function ExhibitPreviewCard({
/>
</svg>
</div>
<Link href={`/spotlightPage/${id}`}>
<Link href={`/exhibitsPage/#a${id}`}>
<h3 className="relative truncate font-medium font-lato text-night pr-[0.31rem] pl-[0.75rem] pt-[0rem] pb-[0rem] text-base leading-normal">
{name1}
</h3>
Expand Down
2 changes: 1 addition & 1 deletion src/components/userComponents/SiteMap/SiteMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { renderToStaticMarkup } from 'react-dom/server';

import { fetchAllSpotlights } from '../../../supabase/tours/queries';
import { ExhibitWithCategoryRow, TourRow } from '../../../types/types';

import Control from './Control';
import DisplayPreviewCard from './DisplayPreviewCard';
import { fetchAllExhibits } from '../../../supabase/exhibits/queries';
import { getCategoryColor1 } from '../../../supabase/category/queries';
import RecenterMap from './MapInteractionHandler';
Expand Down

0 comments on commit f6cdcf9

Please sign in to comment.