Skip to content

Commit

Permalink
fixing rebase by copy pasting from github
Browse files Browse the repository at this point in the history
  • Loading branch information
jxmoose committed Mar 22, 2024
1 parent beeff58 commit e5a4f81
Show file tree
Hide file tree
Showing 5 changed files with 168 additions and 264 deletions.
5 changes: 2 additions & 3 deletions src/app/featuredToursPage/[tourId]/[displayId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,11 @@ export default function TourStopPage({
);
}
};
};

// Fetch the display media
const fetchDisplayMedia = async () => {
const displayMedia = await fetchImagesForDisplay(params.displayId);
setMedia(displayMedia);
setMedia(displayMedia || []);
};

getDisplay();
Expand Down Expand Up @@ -138,4 +137,4 @@ export default function TourStopPage({
</div>
</div>
);
}
}
24 changes: 10 additions & 14 deletions src/app/spotlightPage/[spotlightId]/[displayId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,16 @@ export default function Page({
</h1>

<div className="flex space-x-[14px] pl-[25px] pt-[16px] w-screen overflow-x-auto">
{otherDisplays.map(otherDisplay => (
<Link
key={otherDisplay.id}
href={`/spotlightPage/${params.spotlightId}/${otherDisplay.id}?spotlightId=${params.spotlightId}`}
>
<button
type="button"
className="bg-[#7CA24E] w-[163px] h-[74px] text-white font-bold rounded-2xl p-[25px]"
>
{otherDisplay.title}
</button>
</Link>
))}
{otherDisplays.map(
otherDisplay => (
<Link key={otherDisplay.id} href={`/spotlightPage/${params.spotlightId}/${otherDisplay.id}?spotlightId=${params.spotlightId}`} >
<button type="button" className="bg-[#7CA24E] w-[163px] h-[74px] text-white font-bold rounded-2xl p-[25px]">
{otherDisplay.title}
</button>
</Link>

))}
</div>
</div>
);
}
}
49 changes: 8 additions & 41 deletions src/app/spotlightPage/[spotlightId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ import {
*/
export default function Page({ params }: { params: { spotlightId: string } }) {
const [spotlight, setSpotlight] = useState<TourRow>({
created_at: 'N/A',
description: 'N/A',
id: '0',
name: 'N/A',
created_at: 'N/A',
description: 'N/A',
id: '0',
Expand All @@ -35,32 +31,27 @@ export default function Page({ params }: { params: { spotlightId: string } }) {
stop_count: 0,
});

const [displays, setDisplays] = useState<DisplayRow[]>([]);
const [displays, setDisplays] = useState<DisplayRow[]>([]);

const [relatedSpolights, setRelatedSpotlight] = useState<TourRow[]>([]);
// const [relatedSpolights, setRelatedSpotlight] = useState<TourRow[]>([])

useEffect(() => {
/**
* @returns data from tour table and display table
*/
async function fetchData() {
try {
const responseDataForSpotlight: TourRow = await fetchTour(
params.spotlightId,
);
const responseDataForSpotlight: TourRow = await fetchTour(
params.spotlightId,
);
setSpotlight(responseDataForSpotlight);
const responseDataForDisplays: DisplayRow[] =
await fetchDisplayfromSpotlight(params.spotlightId);
const responseDataForDisplays: DisplayRow[] =
await fetchDisplayfromSpotlight(params.spotlightId);
setDisplays(responseDataForDisplays);
const responseDataForRelatedSpotlights: TourRow[] =
await fetchRelatedSpotlightsfromSpotlightId(params.spotlightId);
setRelatedSpotlight(responseDataForRelatedSpotlights);

// const responseDataForRelatedSpotlights: TourRow[] = await fetchRelatedSpotlightsfromSpotlightId(params.spotlightId);
// setRelatedSpotlight(responseDataForRelatedSpotlights);

} catch (error) {
console.error(error);
}
Expand All @@ -81,20 +72,13 @@ export default function Page({ params }: { params: { spotlightId: string } }) {
{' '}
CATEGORY TWO
</h1>
<h1 className="text-green-700 font-Lato text-base font-normal pl-[18px] pt-[31px]">
{' '}
CATEGORY TWO
</h1>
<h1 className="text-[#333333] text-3xl text-14 font-bold pl-[18px] pt-[8px]">
{spotlight.name}
</h1>
<p className="text-[#333333] p-4">{spotlight.description}</p>
<h1 className="text-black font-Lato font-bold text-[18px] font-medium pl-[18px]">
In this spotlight...
</h1>
<h1 className="text-black font-Lato font-bold text-[18px] font-medium pl-[18px]">
In this spotlight...
</h1>
<div className="flex flex-wrap mt-2 pl-2">
{displays.map(display => (
<Link
Expand All @@ -109,30 +93,14 @@ export default function Page({ params }: { params: { spotlightId: string } }) {
</button>
</Link>
))}
{displays.map(display => (
<Link
key={display.id}
href={`/spotlightPage/${spotlight.id}/${display.id}?spotlightId=${spotlight.id}`}
>
<button
type="button"
className="bg-[#7CA24E] w-[163px] h-[74px] text-white font-bold rounded-2xl p-[21px] m-2 mb-4"
>
{display.title}
</button>
</Link>
))}
</div>

<h1 className="text-black font-Lato font-bold text-[18px] font-medium pl-[18px] pb-[16px]">
Related Spotlights
</h1>
<h1 className="text-black font-Lato font-bold text-[18px] font-medium pl-[18px] pb-[16px]">
Related Spotlights
</h1>

<ul className="list-none p-0 flex">
{relatedSpolights.map(otherSpotlight => (
{/* {relatedSpolights.map(otherSpotlight => (
<li
className="pl-[18px] w-[162px] overflow-x-auto"
key={otherSpotlight.id}
Expand All @@ -147,9 +115,8 @@ export default function Page({ params }: { params: { spotlightId: string } }) {
</h2>
</Link>
</li>
))}
))} */}
</ul>
</div>
);
}

}
Loading

0 comments on commit e5a4f81

Please sign in to comment.