Skip to content

Commit 189d46f

Browse files
authored
Merge pull request #105 from UoaWDCC/feat/custom-payload-component
feat: custom payload admin components
2 parents c98eb5c + adc4f63 commit 189d46f

File tree

25 files changed

+656
-112
lines changed

25 files changed

+656
-112
lines changed

.env.example

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
# Added by Payload
2-
PAYLOAD_SECRET=97d6832f717898a0943c98f7
3-
DATABASE_URI=mongodb://localhost:27017/
1+
PAYLOAD_SECRET=""
2+
DATABASE_URI=""
3+
4+
S3_ACCESS_KEY_ID=""
5+
S3_SECRET_ACCESS_KEY=""
6+
S3_BUCKET=""
7+
S3_REGION=""

README.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
3. make colours/colour variables consistent across website (including logos)
88
4. check text uses p, h1, etc. tags for seo
99
5. add secondary global font to repo
10-
6. routing? (with dashes)
11-
7. add type props to files in /actions
12-
8. blur when image is rendering
13-
9. global util file (stringToList, url checker for Media, etc.)
14-
10. rename header to hero.tsx (so not to be confused with global header)
15-
11. purge codebase of .env and login details
16-
12. add notes to custom react component - some links have fallbacks (e.g. constitution/youtube video, etc.)
10+
6. routing? (with dashes) \*\*
11+
7. blur when image is rendering
12+
8. global util file (stringToList, url checker for Media, etc.) \*\*
13+
9. some links have fallbacks (e.g. constitution/youtube video, etc.) \*
1714

1815
### BUGS
1916

@@ -46,20 +43,6 @@
4643
5. Go to your browser and enter: "http://localhost:3000"
4744
6. Any saved changes you make in VS Code will be automatically reflected in localhost:3000
4845

49-
### Add .env file under ausco (root directory)
50-
51-
```
52-
PAYLOAD_SECRET="a710400222333f83c1b1bd6abb7bd3116e3321f813c48efe8ba93bc75cd16b82"
53-
DATABASE_URI="mongodb+srv://ausco:[email protected]/"
54-
```
55-
56-
### Payload admin login
57-
58-
```
59-
60-
e1160e47
61-
```
62-
6346
## Development
6447

6548
### How to Start Development
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
type HeaderProps = {
1+
type HeroProps = {
22
title: string;
33
description?: string;
44
};
55

6-
const Header = ({ title, description }: HeaderProps) => {
6+
const Hero = ({ title, description }: HeroProps) => {
77
return (
88
<section className="w-full pb-8 sm:pb-12 md:pb-16 flex flex-col items-center text-center text-(--brown)">
99
<h1 className="text-2xl sm:text-3xl md:text-4xl px-6 sm:px-0">{title}</h1>
@@ -14,4 +14,4 @@ const Header = ({ title, description }: HeaderProps) => {
1414
);
1515
};
1616

17-
export default Header;
17+
export default Hero;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
type Align = "center" | "left";
22

3-
type HeaderProps = {
3+
type HeroProps = {
44
title: string;
55
align: Align;
66
};
@@ -10,14 +10,14 @@ const textDirection: Record<Align, string> = {
1010
left: "text-left",
1111
};
1212

13-
const Header = ({ title, align }: HeaderProps) => {
13+
const Hero = ({ title, align }: HeroProps) => {
1414
return (
15-
<section className="w-full pb-8 sm:pb-12 md:pb-16 flex flex-col items-center text-(--navy)">
15+
<section className="flex w-full flex-col items-center pb-8 text-(--navy) sm:pb-12 md:pb-16">
1616
<div className={`w-full text-center sm:${textDirection[align]} px-6 sm:px-0`}>
1717
<h1 className="text-2xl sm:text-3xl md:text-4xl">{title}</h1>
1818
</div>
1919
</section>
2020
);
2121
};
2222

23-
export default Header;
23+
export default Hero;

src/app/(frontend)/components/home/FeatureVideo.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ type FeatureVideoProps = {
1111
const FeatureVideo = ({ content }: FeatureVideoProps) => {
1212
const sectionRef = useRef<HTMLElement | null>(null);
1313
const videoContainerRef = useRef<HTMLDivElement | null>(null);
14-
const [showHeader, setShowHeader] = useState(true); // TODO: maybe safe to remove/hard code showHeader if its a constant
14+
// const [showHeader, setShowHeader] = useState(true);
15+
const showHeader = true;
1516
const [maxScale, setMaxScale] = useState<number>(3);
1617
const [sectionHeight, setSectionHeight] = useState<string>("100vh");
1718

@@ -81,12 +82,12 @@ const FeatureVideo = ({ content }: FeatureVideoProps) => {
8182
return (
8283
<motion.section
8384
ref={sectionRef}
84-
className="relative flex flex-col items-center justify-center py-8 gap-8 w-full"
85+
className="relative flex w-full flex-col items-center justify-center gap-8 py-8"
8586
style={{ backgroundColor: bgColor, minHeight: sectionHeight }}
8687
>
8788
{/* Header */}
8889
<motion.h2
89-
className="w-full max-w-[90vw] text-[2rem] sm:text-[2.7rem] font-bold text-center tracking-tight leading-tight whitespace-nowrap overflow-hidden text-ellipsis relative z-20"
90+
className="relative z-20 w-full max-w-[90vw] overflow-hidden text-center text-[2rem] leading-tight font-bold tracking-tight text-ellipsis whitespace-nowrap sm:text-[2.7rem]"
9091
style={{
9192
color: "var(--concertblue)",
9293
opacity: headerOpacity,
@@ -100,13 +101,13 @@ const FeatureVideo = ({ content }: FeatureVideoProps) => {
100101
{/* Feature Video */}
101102
<motion.div
102103
ref={videoContainerRef}
103-
className="flex items-center justify-center mx-auto bg-black relative overflow-hidden w-[180px] sm:w-[420px] md:w-[660px] max-w-[100vw] aspect-video z-10"
104+
className="relative z-10 mx-auto flex aspect-video w-[180px] max-w-[100vw] items-center justify-center overflow-hidden bg-black sm:w-[420px] md:w-[660px]"
104105
style={{ scale: scaleValue }}
105106
>
106107
<iframe
107108
loading="lazy"
108109
src={embedUrl}
109-
className="w-full h-full"
110+
className="h-full w-full"
110111
allow="autoplay; fullscreen; encrypted-media"
111112
allowFullScreen
112113
title="Past concert video"

src/app/(frontend)/components/ourpeople/Header.tsx renamed to src/app/(frontend)/components/ourpeople/Hero.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import Image from "next/image";
22

33
import { Media } from "@/payload-types";
44

5-
type HeaderProps = {
5+
type HeroProps = {
66
content: {
77
image: Media | string | null;
88
description?: string | null;
99
};
1010
};
1111

12-
const Header = ({ content }: HeaderProps) => {
12+
const Hero = ({ content }: HeroProps) => {
1313
return (
1414
<>
1515
<section className="relative w-full pb-8 sm:flex sm:flex-row sm:items-center sm:gap-16 sm:pb-12 md:pb-16">
1616
{typeof content.image === "object" && content.image?.url && (
1717
<div className="relative h-[22vh] w-full sm:h-[28vh] md:aspect-3/2 md:h-auto md:w-1/2">
1818
<Image
1919
src={content.image.url}
20-
alt={content.image.alt || "Header Image"}
20+
alt={content.image.alt || "Hero Image"}
2121
fill
2222
priority
2323
sizes="(max-width: 640px) 100vw, 50vw"
@@ -44,4 +44,4 @@ const Header = ({ content }: HeaderProps) => {
4444
);
4545
};
4646

47-
export default Header;
47+
export default Hero;

src/app/(frontend)/components/ourstory/Header.tsx

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
type HeroProps = {
2+
description?: string | null;
3+
};
4+
5+
const Hero = ({ description }: HeroProps) => {
6+
return (
7+
<section className="flex w-full flex-col items-center pb-8 text-left text-(--navy) sm:pb-12 sm:text-center md:pb-16">
8+
<h1 className="w-full px-0 text-2xl sm:px-6 sm:text-3xl md:text-4xl">Our Story</h1>
9+
{description && (
10+
<h3 className="px-0 pt-3 text-sm sm:px-15 md:px-30 md:pt-7 md:text-base">{description}</h3>
11+
)}
12+
</section>
13+
);
14+
};
15+
16+
export default Hero;

src/app/(frontend)/concerts/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import { getConcerts } from "@/actions/pageActions";
22

3-
import Header from "@components/concerts/Header";
3+
import Hero from "@components/concerts/Hero";
44
import Card from "@components/concerts/Card";
55

66
export default async function Concerts() {
77
const content = await getConcerts();
88

99
return (
1010
<section className="bg-(--cream)">
11-
<div className="w-full max-w-6xl mx-auto pt-44 pb-8 sm:pb-12 md:pb-16 px-6 flex flex-col items-center">
12-
<Header title="Concerts" />
11+
<div className="mx-auto flex w-full max-w-6xl flex-col items-center px-6 pt-44 pb-8 sm:pb-12 md:pb-16">
12+
<Hero title="Concerts" />
1313

14-
<div className="flex flex-col sm:flex-row justify-between items-center gap-6 w-full">
14+
<div className="flex w-full flex-col items-center justify-between gap-6 sm:flex-row">
1515
{/* Upcoming Concerts Button */}
1616
<Card background={content.upcoming} type="upcoming" />
1717

src/app/(frontend)/concerts/past/page.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { getConcertsPast } from "@/actions/pageActions";
22

3-
import Header from "@components/concerts/Header";
3+
import Hero from "@components/concerts/Hero";
44
import SemesterConcert from "@components/concerts/past/SemesterConcert";
55

66
export default async function Past() {
77
const content = await getConcertsPast();
88

99
return (
1010
<div className="bg-(--cream)">
11-
<div className="max-w-6xl mx-auto px-6 pt-44">
12-
<Header title="Past Concerts" description={content.description} />
11+
<div className="mx-auto max-w-6xl px-6 pt-44">
12+
<Hero title="Past Concerts" description={content.description} />
1313

1414
{/* Past Concerts */}
1515
<section className="text-left">
@@ -18,19 +18,19 @@ export default async function Past() {
1818
.map((concert, index) => (
1919
<div key={index} className="pb-8 sm:pb-12 md:pb-16">
2020
{/* Divider */}
21-
<div className="hidden lg:block w-full h-px bg-(--brown) mb-16" />
21+
<div className="mb-16 hidden h-px w-full bg-(--brown) lg:block" />
2222

2323
{/* Year */}
24-
<h1 className="text-center lg:text-left text-lg sm:text-xl md:text-2xl text-(--brown) pb-3 md:pb-7">
24+
<h1 className="pb-3 text-center text-lg text-(--brown) sm:text-xl md:pb-7 md:text-2xl lg:text-left">
2525
{concert.year}
2626
</h1>
2727

2828
{/* Concerts - Semester 1 & 2 */}
29-
<div className="flex flex-col lg:flex-row gap-4 sm:gap-7 md:gap-9 items-start bg-(--beige) w-full rounded-lg p-4 sm:p-7 md:p-9">
29+
<div className="flex w-full flex-col items-start gap-4 rounded-lg bg-(--beige) p-4 sm:gap-7 sm:p-7 md:gap-9 md:p-9 lg:flex-row">
3030
<SemesterConcert semester="1" content={concert.semesterOne} />
3131

3232
<div
33-
className="block lg:hidden w-full bg-(--brown)"
33+
className="block w-full bg-(--brown) lg:hidden"
3434
style={{ height: "0.5px" }}
3535
/>
3636

0 commit comments

Comments
 (0)