Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Andrei/phs 50 ii hifi home screen web and design updates #78

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
bb6e181
feat: web screens met, testing on iPhone SE screens + switch to web: …
andreisito Apr 26, 2024
b396bfa
feat: iPhone SE debugged, window containers required
andreisito Apr 26, 2024
5114797
chore: sync
andreisito Apr 26, 2024
07b786b
feat+bug: Hover and Focus effects added to visitor resources buttons.…
andreisito May 6, 2024
0907b78
chore: Added hover + focus effects to buttons, reorganized files re…
andreisito May 6, 2024
dfbae96
fix: padding on title header and sizing of exhibit button styling, Ga…
andreisito May 6, 2024
2fd0d50
fix: Galaxy Fold 5 + Iphone SE boundary error fixed. Note: aim to us…
andreisito May 6, 2024
fca6ce5
fix: fixed bounding issues again + visitor resources button styling f…
andreisito May 6, 2024
cb07427
feat: transition to using React Context for window resize checks, sho…
andreisito May 7, 2024
b98b1b6
Claire fixes (#63)
miha-bhaskaran May 13, 2024
244c4b4
Revert "Claire fixes (#63)" (#64)
sarahhpeng May 14, 2024
951abf3
package changed
sarahhpeng May 14, 2024
36f2519
change useWebScreenDetection to useWebDeviceDetection (#68)
davidqing6432 May 22, 2024
39e3e8c
fixed some linting errors, mostly jsdocs (#69)
davidqing6432 May 22, 2024
3d7b9ed
news feed web (#61)
jxmoose May 22, 2024
faf1d57
Justin exhibit redo (#67)
jxmoose May 22, 2024
3b0450e
fixed all eslint errors, still some warnings, introduced some ignores…
davidqing6432 May 22, 2024
c718c55
fixed remaining errors (#71)
davidqing6432 May 22, 2024
0c589fe
Phs sitemap fix (#66)
miha-bhaskaran May 22, 2024
2d2f884
Christophertorres/phs final tours spotlights styling (#62)
christophertorres1 May 25, 2024
7ec71d2
deleted outdated images from public folder and updated navBar folder …
sarahhpeng May 25, 2024
161e7d0
renamed navBar to NavBar (#73)
sarahhpeng May 25, 2024
0e6c2fe
Phs site map eslint (#74)
miha-bhaskaran May 26, 2024
fd1b437
Justin footer redo (#75)
jxmoose May 26, 2024
92273d8
Noah/fix window reference (#77)
oahnh May 27, 2024
fe9756b
added correct links to site map (#76)
jxmoose May 27, 2024
e2ff808
merge resolved
andreisito Jul 24, 2024
5b505b4
style
andreisito Jul 24, 2024
0212298
nothing
andreisito Jul 24, 2024
251e85e
feat: iPhone SE debugged, window containers required
andreisito Apr 26, 2024
b37a6a9
feat+bug: Hover and Focus effects added to visitor resources buttons.…
andreisito May 6, 2024
fad5108
chore: Added hover + focus effects to buttons, reorganized files re…
andreisito May 6, 2024
863bfc5
fix: misc changes to styling and fixing some console log errors
andreisito May 7, 2024
6c66baa
feat + fix: web design system set up, fixed lato font
andreisito May 7, 2024
f315b85
fix: resolving old merge conflicts
andreisito Sep 16, 2024
a49bb3f
feat: web screens met, testing on iPhone SE screens + switch to web: …
andreisito Apr 26, 2024
ceb544e
feat: iPhone SE debugged, window containers required
andreisito Apr 26, 2024
855af10
chore: sync
andreisito Apr 26, 2024
a3337e5
feat+bug: Hover and Focus effects added to visitor resources buttons.…
andreisito May 6, 2024
e82ac20
chore: Added hover + focus effects to buttons, reorganized files re…
andreisito May 6, 2024
7d2114b
Claire fixes (#63)
miha-bhaskaran May 13, 2024
1668d91
Revert "Claire fixes (#63)" (#64)
sarahhpeng May 14, 2024
902f151
merge resolved
andreisito Jul 24, 2024
92afe75
style
andreisito Jul 24, 2024
b836313
nothing
andreisito Jul 24, 2024
cd77bcc
feat: iPhone SE debugged, window containers required
andreisito Apr 26, 2024
6b0f467
feat+bug: Hover and Focus effects added to visitor resources buttons.…
andreisito May 6, 2024
7fa1d1b
chore: Added hover + focus effects to buttons, reorganized files re…
andreisito May 6, 2024
1fe6e17
fix: misc changes to styling and fixing some console log errors
andreisito May 7, 2024
5f8b206
feat + fix: web design system set up, fixed lato font
andreisito May 7, 2024
5c6582a
fix: resolving old merge conflicts
andreisito Sep 16, 2024
2209d91
sync with origin
andreisito Sep 16, 2024
1b58914
sync with origin
andreisito Sep 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 137 additions & 0 deletions src/app/featuredToursPage/[tourId]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
'use client';

import React, { useEffect, useState } from 'react';
import Image from 'next/image';
import Link from 'next/link';

import { fetchAllDisplays } from '../../../supabase/displays/queries';
import { fetchMedia } from '../../../supabase/media/queries';
import { fetchTour } from '../../../supabase/tours/queries';
import { fetchTourDisplays } from '../../../supabase/tour_displays/queries';
import { fetchTourMedia } from '../../../supabase/tour_media/queries';
import {
DisplayRow,
MediaRow,
TourDisplaysRow,
TourMediaRow,
TourRow,
} from '../../../types/types';

import BackButton from '../../../components/userComponents/BackButton/BackButton';
import NavBar from '../../../components/userComponents/navBar/navBar';

/**
* @param params -
* @param params.params -
* @param params.params.tourId - The tour ID
* @returns The tour start page
*/
export default function TourStartPage({
params,
}: {
params: { tourId: string };
}) {
const [tour, setTour] = useState<TourRow>();
const [tourDisplays, setTourDisplays] = useState<TourDisplaysRow[]>([]);
const [displays, setDisplays] = useState<DisplayRow[]>([]);
const [tourMedia, setTourMedia] = useState<TourMediaRow[]>([]);
const [media, setMedia] = useState<MediaRow[]>([]);

useEffect(() => {
// Fetch tour, tour displays, and tour media data
const fetchData = async () => {
const fetchedTour = await fetchTour(params.tourId);
setTour(fetchedTour);
const fetchedTourDisplays = await fetchTourDisplays(params.tourId);
setTourDisplays(fetchedTourDisplays);
const fetchedDisplays = await fetchAllDisplays();
setDisplays(fetchedDisplays);
const fetchedTourMedia = await fetchTourMedia(params.tourId);
setTourMedia(fetchedTourMedia);
const fetchedMedia = await fetchMedia();
setMedia(fetchedMedia);
};

fetchData();
}, [params.tourId]);

return (
tour && (
<div className="bg-ivory w-[24.375rem] min-h-screen">
<NavBar />
<Link
href="/featuredToursPage"
className="absolute top-[5.25rem] left-[1.12rem] z-10"
>
<BackButton />
</Link>
<div className="bg-scary-forest relative w-[24.375rem] h-[15.3125rem]">
{media.length > 0 && (
<Image
key={media.find(m => m.id === tourMedia[0]?.media_id)?.id}
src={media.find(m => m.id === tourMedia[0]?.media_id)?.url ?? ''}
alt={media.find(m => m.id === tourMedia[0]?.media_id)?.text ?? ''}
layout="fill"
objectFit="cover"
priority
/>
)}
</div>

<div className="w-[24.375rem] flex flex-col px-[1.125rem] absolute top-[17.81rem] gap-6 mb-[2.5rem]">
<div className="bg-mint-green w-[22.125rem] rounded-md px-[2.1875rem] py-[2.25rem] flex-col items-center gap-3 inline-flex">
<div className="flex flex-col w-[22.125rem] rounded-md px-[2.1875rem] text-center gap-1">
<h2 className="text-night text-sm font-lato font-normal">
WELCOME TO
</h2>
<h1 className="text-night font-lato text-[2rem] truncate font-bold">
{tour.name}
</h1>
</div>
<div className="w-[12.625rem] px-4 py-[0.62rem] bg-asparagus rounded-lg justify-center items-center gap-2.5">
<Link
href={`/featuredToursPage/${params.tourId}/${tourDisplays[0]?.display_id}`}
>
<h2 className="text-ivory text-center text-base font-lato font-bold">
Start Tour
</h2>
</Link>
</div>
</div>

<p className="text-night font-lato font-normal">{tour.description}</p>

<div className="flex flex-col relative gap-4 mb-10">
<div className="flex justify-between items-center">
<h3 className="text-night font-lato text-lg font-bold">
In this tour
</h3>
<div className="bg-[#F5EDCF80] w-[4.375rem] h-[1.5rem] rounded-[0.5625rem] px-3 py-1">
<p className="text-night font-lato font-normal text-xs text-center">
{tour.stop_count} stops
</p>
</div>
</div>
<ol>
{tourDisplays.map(tourDisplay => (
<li key={tourDisplay.display_id} className="mb-[0.44rem] ml-4">
<h4 className="font-normal font-lato">
{tourDisplay.display_order != null
? tourDisplay.display_order + 1
: ''}
.{' '}
{
displays.find(
display => display.id === tourDisplay.display_id,
)?.title
}
</h4>
</li>
))}
</ol>
</div>
</div>
</div>
)
);
}
142 changes: 142 additions & 0 deletions src/app/featuredToursPage/[tourId]/tourEndPage/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
'use client';

import Link from 'next/link';
import React, { useEffect, useState } from 'react';

import NavBar from '../../../../components/userComponents/navBar/navBar';
import {
MediaRow,
TourRow,
TourMediaRow,
TourDisplaysRow,
} from '../../../../types/types';
import { fetchMedia } from '../../../../supabase/media/queries';
import { fetchTour } from '../../../../supabase/tours/queries';
import { fetchTourDisplays } from '../../../../supabase/tour_displays/queries';
import { fetchTourMedia } from '../../../../supabase/tour_media/queries';
import {
BackArrow,
Congratulations,
ExternalLinkIcon,
} from '../../../../../public/icons';

/**
* @param params -
* @param params.params -
* @param params.params.tourId - The tour ID
* @returns The tour end page
*/
export default function TourEndPage({
params,
}: {
params: { tourId: string };
}) {
const [media, setMedia] = useState<MediaRow[]>([]);
const [tour, setTour] = useState<TourRow>();
const [tourMedia, setTourMedia] = useState<TourMediaRow[]>([]);
const [backLink, setBackLink] = useState<string>(
`/featuredToursPage/${params.tourId}`,
);

useEffect(() => {
// Get tour
const getTour = async () => {
const fetchedTour = await fetchTour(params.tourId);
setTour(fetchedTour);
};

// Get tour media
const getTourMedia = async () => {
const fetchedTourMedia = await fetchTourMedia(params.tourId);
setTourMedia(fetchedTourMedia);
};

// Get media
const getMedia = async () => {
const fetchedMedia = await fetchMedia();
setMedia(fetchedMedia);
};

/**
* @returns The link to the previous page.
*/
async function getBackLink() {
const tourDisplays: TourDisplaysRow[] = await fetchTourDisplays(
params.tourId,
);
setBackLink(
`/featuredToursPage/${params.tourId}/${
tourDisplays[tourDisplays.length - 1].display_id
}`,
);
}

getTour();
getTourMedia();
getMedia();
getBackLink();
}, [params.tourId]);

return (
<div className="bg-ivory w-[24.375rem] min-h-screen">
<NavBar />
<Link href={backLink} className="relative top-4 left-[1.12rem]">
<BackArrow />
</Link>

<div className="flex flex-col gap-10 mt-8 mb-10">
<div className="flex flex-col items-center gap-8 mx-[3.47rem]">
<div className="flex flex-col gap-3 text-center">
<div className="flex flex-col items-center gap-5 mx-[2.34rem]">
<Congratulations />
<h1 className="text-night font-lato text-xl font-semibold">
{`You've reached the end of this tour!`}
</h1>
</div>
<p className="text-night font-lato text-sm font-normal">
Thanks for visiting {tour?.name}.
</p>
</div>
<div className="bg-asparagus w-[13.75rem] text-center rounded-lg">
<Link href="/featuredToursPage">
<h2 className="text-ivory font-lato text-base font-bold px-4 py-[0.62rem]">
Back to Virtual Tours
</h2>
</Link>
</div>
</div>

<div className="bg-[#F5F6F5] mb-10">
<div className="bg-[#BDBDBD] h-[0.03125rem]" />
<div className="flex flex-col px-[1.12rem] py-8 gap-6">
<h3 className="text-night font-lato font-bold">Related Links</h3>
<ol className="px-[0.88rem]">
{tourMedia.map((tm, index) => (
<li key={tm.media_id} className="flex flex-col gap-4">
<Link
href={media.find(m => m.id === tm.media_id)?.url ?? '-1'}
className="flex flex-col gap-1"
>
<div className="flex flex-row items-center gap-2">
<h4 className="text-shadow font-lato text-sm font-normal uppercase">
{media.find(m => m.id === tm.media_id)?.type}
</h4>
<ExternalLinkIcon />
</div>
<h4 className="text-night font-lato font-medium">
{media.find(m => m.id === tm.media_id)?.title}
</h4>
</Link>
{index !== tourMedia.length - 1 && (
<div className="bg-[#BDBDBD] h-[0.03125rem] mb-6" />
)}
</li>
))}
</ol>
</div>
<div className="bg-[#BDBDBD] h-[0.03125rem]" />
</div>
</div>
</div>
);
}
Loading
Loading