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

Feat/uads 18/front end home page #7

Merged
merged 81 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
b0edfe4
UADS-18 feat: add basic tailwind template
khir829 Apr 26, 2024
a0d8f40
UADS-18 feat basic event card
n1cholastan Apr 29, 2024
1044ec4
UADS-18 fix logo moved
n1cholastan Apr 29, 2024
e523b27
UADS-18 feat updated event card
n1cholastan Apr 29, 2024
e9b9671
UADS-18 feat additional sponsor info
becky-n Apr 29, 2024
7ea81ec
Merge branch 'feat/UADS-18/front-end-home-page' of https://github.com…
becky-n Apr 29, 2024
bb23b99
UADS-18 feat changes to sponsor cards
becky-n Apr 29, 2024
357ea2c
UADS-18 feat "PinkButton" component for general buttons, sign up sect…
n1cholastan Apr 29, 2024
104fb67
UADS-18 style: format and fix code
khir829 May 1, 2024
3e50336
UADS-18 feat EventCardProps
n1cholastan May 1, 2024
034397d
UADS-18 feat updating home page
becky-n May 2, 2024
01f79b5
UADS-18 feat removing read more button
becky-n May 2, 2024
bc9d879
Merge branch 'main' into feat/UADS-18/front-end-home-page
n1cholastan May 3, 2024
ea7f075
Merge branch 'main' into feat/UADS-18/front-end-home-page
Harsheel12 May 3, 2024
6b2a797
Merge branch 'feat/UADS-18/front-end-home-page' of https://github.com…
becky-n May 6, 2024
44dd428
Merge branch 'feat/UADS-18/front-end-home-page' of https://github.com…
n1cholastan May 6, 2024
4b1360d
UADS-18 style changing colours
n1cholastan May 6, 2024
1c886a3
UADS-18 feat adding to landing page
becky-n May 6, 2024
fae2058
Merge branch 'feat/UADS-18/front-end-home-page' of https://github.com…
becky-n May 6, 2024
726310a
UADS-18 feat new logo colour
n1cholastan May 6, 2024
403a3bb
UADS-18 style gradient-background
n1cholastan May 6, 2024
b2c794d
UADS-18 feat css changes to landing
becky-n May 6, 2024
b2194ee
UADS-18 style added new svgs
n1cholastan May 6, 2024
b370fec
Merge branch 'feat/UADS-18/front-end-home-page' of https://github.com…
n1cholastan May 6, 2024
fd6739f
UADS-18 feat fixes to fonts
becky-n May 6, 2024
a6252a2
Merge branch 'feat/UADS-18/front-end-home-page' of https://github.com…
becky-n May 6, 2024
21e4ff4
UADS-18 chore: reformat home page code
khir829 May 10, 2024
51ad605
UADS-18 style: update sponsor card to fit design
khir829 May 10, 2024
88589d7
UADS-18 chore: add react slick dependency
khir829 May 10, 2024
0b0152f
UADS-18 feat: add animated image logo slider
khir829 May 10, 2024
8d30d9e
UADS-18 style: add images to sponsors section
khir829 May 10, 2024
da76370
UADS-18 fix: home page gradient
khir829 May 10, 2024
1d9f6c5
UADS-18 fix: width not aligning with home screen
khir829 May 10, 2024
128dbf9
UADS-18 refactor: sponsor dummy data for home
khir829 May 10, 2024
99f60dc
UADS-18 refactor: remove unnecessary element
khir829 May 10, 2024
7b982e7
UADS-18 feat updating colours
becky-n May 10, 2024
167c156
Merge branch 'feat/UADS-18/front-end-home-page' of https://github.com…
becky-n May 10, 2024
221f825
UADS-18 feat adding images and bg grad
becky-n May 12, 2024
ae14031
UADS-18 feat adding resizing screen for images
becky-n May 12, 2024
0d8c868
UADS-19 fix adding responsiveness
n1cholastan May 13, 2024
cf449ef
UADS-18 fix logo in front of images
becky-n May 13, 2024
879dce4
UADS-18 fix added mobile-first responsive card
n1cholastan May 13, 2024
a6a0c98
Merge branch 'feat/UADS-18/front-end-home-page' of https://github.com…
n1cholastan May 13, 2024
64e36fd
UADS-18 style added event background
n1cholastan May 16, 2024
47c5248
UADS-18 style: line-clamp module
n1cholastan May 16, 2024
cfd6cb2
UADS-18 fix: Fixed incorrect package install
Harsheel12 May 17, 2024
174e8d5
UADS-18 style SignUpSection changes
n1cholastan May 20, 2024
4c046f3
UADS-18 fix: react slick slider
khir829 May 23, 2024
cc9f3a1
UADS-18 style: remake event card
khir829 May 23, 2024
902131d
UADS-18 feat: make events into a slider
khir829 May 23, 2024
bf58b8f
Merge branch 'main' into feat/UADS-18/front-end-home-page
khir829 May 29, 2024
2f6cda1
UADS-18 style: use chosen svgs for images
khir829 May 29, 2024
c668041
UADS-18 style: make slider elements responsive
khir829 May 31, 2024
0fd22c0
UADS-18 fix: incorrect text dispaly on event card
khir829 May 31, 2024
9cd8780
UADS-18 chore: remove unused code
khir829 May 31, 2024
e516c06
UADS-18 style: add sponsors section bg images
khir829 May 31, 2024
ca78197
UADS-18 style: make sponsor images responsive
khir829 May 31, 2024
8e072e7
UADS-18 style: add bg elements to events section
khir829 May 31, 2024
d12469e
UADS-18 fix: home page join button style
khir829 May 31, 2024
412709f
UADS-18 refactor: abstract event card component
khir829 May 31, 2024
f622d54
UADS-18 fix: window width overflow issue
khir829 May 31, 2024
7cc7f43
UADS-18 fix: enable slider autoplay
khir829 May 31, 2024
175d804
UADS-18 style: update responsiveness
khir829 May 31, 2024
51cea5a
UADS-18 style: resize landing section of home page
khir829 May 31, 2024
3e543b1
UADS-18 fix: center icecream svg
khir829 Jun 14, 2024
1d1d334
UADS-18 style: resize landing section components
khir829 Jun 14, 2024
cbfefd3
Merge branch 'main' into feat/UADS-18/front-end-home-page
khir829 Jun 14, 2024
44119ec
UADS-18 feat: add navbar to about page
khir829 Jun 14, 2024
822245f
UADS-18 refactor: reformat imports
khir829 Jun 14, 2024
48166f5
UADS-18 test: add additional setup for tests
khir829 Jun 14, 2024
c3515cf
UADS-18 fix: resolve navbar overlap bug
khir829 Jun 14, 2024
df2894f
Merge branch 'main' into feat/UADS-18/front-end-home-page
khir829 Jun 21, 2024
ee6bcb0
UADS-18 feat: add footer to home page
khir829 Jun 21, 2024
c93b728
UADS-18 test: fix test case
khir829 Jun 21, 2024
0d702b1
Merge branch 'main' into feat/UADS-18/front-end-home-page
Harsheel12 Jun 24, 2024
1060458
UADS-18 fix: Deleted binary file
Harsheel12 Jun 24, 2024
f2cd7b2
UADS-18 fix: Removed unnecessary stuffs
Harsheel12 Jun 24, 2024
5812efd
UADS-18 feat: Updated Socials component to take props for colours
Harsheel12 Jun 25, 2024
ec4c721
UADS-18 fix: Fixed Socials tests
Harsheel12 Jun 25, 2024
5ba8d2a
UADS-18 feat: Completed Home Page
Harsheel12 Jun 26, 2024
12596de
UADS-18 fix: Removed unnecessary package
Harsheel12 Jun 26, 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"react-icons": "^5.2.1",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0",
"swiper": "^11.1.4",
"tailwind-merge": "^2.2.1",
"universal-cookie": "^7.0.2",
"zod": "^3.22.4"
Expand Down
Binary file added web/src/assets/example-tsujiri-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added web/src/assets/placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions web/src/assets/uads_logo_brown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion web/src/components/EventCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export default function EventCard({ event }: EventCardProps) {
<div className="w-96 flex flex-col bg-pink rounded-3xl overflow-hidden">
<div className="relative h-3/5 group">
<img src={backgroundImage} alt="Background Image" className="w-full h-full object-cover" />
<div className="absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center text-white text-2xl font-bold opacity-0 cursor-pointer group-hover:opacity-100 transition-opacity duration-300">{statusText}</div>
<div className="absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center text-white text-2xl font-bold opacity-0 cursor-pointer group-hover:opacity-100 transition-opacity duration-300">
{statusText}
</div>
</div>

<div className="flex-grow flex rounded-b-3xl">
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function Footer() {
<p className="font-raleway text-light-pink font-bold">&copy; UADS 2024. All Rights Reserved</p>
</div>
<div className="flex justify-center w-full lg:w-auto">
<Socials />
<Socials background="bg-brown" hoverBackground="bg-light-pink" iconColor="text-light-pink" hoverIconColor="text-black" />
</div>
</div>
</div>
Expand Down
29 changes: 18 additions & 11 deletions web/src/components/Socials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,44 @@ import { Link } from "react-router-dom";
import { FaFacebookF, FaInstagram, FaDiscord, FaTiktok } from "react-icons/fa";
import { IoMdMail } from "react-icons/io";

export default function Socials() {
interface SocialsProps {
background: string;
hoverBackground: string;
iconColor: string;
hoverIconColor: string;
}

export default function Socials({ background, hoverBackground, iconColor, hoverIconColor }: SocialsProps) {
return (
<>
<div className="w-80 flex justify-between items-center" data-testid="socialsComponent">
<div className="w-10 h-10 bg-brown rounded-full hover:bg-light-pink cursor-pointer group">
<div className={`w-10 h-10 ${background} rounded-full hover:${hoverBackground} cursor-pointer group`}>
<Link to="https://www.facebook.com/uoadessertsociety" target="_blank" aria-label="Facebook" className="w-full h-full flex justify-center items-center">
<FaFacebookF className="text-light-pink group-hover:text-black" data-testid="facebookLogo" />
<FaFacebookF className={`${iconColor} group-hover:${hoverIconColor}`} data-testid="facebookLogo" />
</Link>
</div>

<div className="w-10 h-10 bg-brown rounded-full hover:bg-light-pink cursor-pointer group">
<div className={`w-10 h-10 ${background} rounded-full hover:${hoverBackground} cursor-pointer group`}>
<Link to="https://www.instagram.com/uoadessertsociety/" target="_blank" aria-label="Instagram" className="w-full h-full flex justify-center items-center">
<FaInstagram className="text-light-pink group-hover:text-black" data-testid="instagramLogo" />
<FaInstagram className={`${iconColor} group-hover:${hoverIconColor}`} data-testid="instagramLogo" />
</Link>
</div>

<div className="w-10 h-10 bg-brown rounded-full hover:bg-light-pink cursor-pointer group">
<div className={`w-10 h-10 ${background} rounded-full hover:${hoverBackground} cursor-pointer group`}>
<Link to="https://discord.gg/dFuwHuU8FT" target="_blank" aria-label="Discord" className="w-full h-full flex justify-center items-center">
<FaDiscord className="text-light-pink group-hover:text-black" data-testid="discordLogo" />
<FaDiscord className={`${iconColor} group-hover:${hoverIconColor}`} data-testid="discordLogo" />
</Link>
</div>

<div className="w-10 h-10 bg-brown rounded-full hover:bg-light-pink cursor-pointer group">
<div className={`w-10 h-10 ${background} rounded-full hover:${hoverBackground} cursor-pointer group`}>
<Link to="https://www.tiktok.com/@uoadessertsociety?_t=8mQ3asFY7Pz&_r=1" target="_blank" aria-label="TikTok" className="w-full h-full flex justify-center items-center">
<FaTiktok className="text-light-pink group-hover:text-black" data-testid="tiktokLogo" />
<FaTiktok className={`${iconColor} group-hover:${hoverIconColor}`} data-testid="tiktokLogo" />
</Link>
</div>

<div className="w-10 h-10 bg-brown rounded-full hover:bg-light-pink cursor-pointer group">
<div className={`w-10 h-10 ${background} rounded-full hover:${hoverBackground} cursor-pointer group`}>
<Link to="mailto:[email protected]" target="_blank" aria-label="Email" className="w-full h-full flex justify-center items-center">
<IoMdMail className="text-light-pink group-hover:text-black" data-testid="emailLogo" />
<IoMdMail className={`${iconColor} group-hover:${hoverIconColor}`} data-testid="emailLogo" />
</Link>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/SponsorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function SponsorCard({ sponsor }: SponsorCardProps) {

return (
<>
<div className="w-96 h-52 bg-pink flex rounded-b-3xl overflow-hidden relative">
<div className="w-96 h-52 bg-brown flex rounded-b-3xl overflow-hidden relative">
<div className="w-full absolute top-0">
<img src={background} alt="Pink Swiggly Background" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/__tests__/Socials.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("Socials Component", () => {
beforeEach(() => {
render(
<MemoryRouter>
<Socials />
<Socials background="bg-brown" hoverBackground="bg-light-pink" iconColor="text-light-pink" hoverIconColor="text-black" />
</MemoryRouter>
);
});
Expand Down
211 changes: 209 additions & 2 deletions web/src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,220 @@
import { NavLink } from "react-router-dom";
import uadslogo from "../assets/uads_logo_brown.svg";
import creamcup from "../assets/cupcake.svg";
import sundae from "../assets/sundae.svg";
import EventCard, { EventType } from "../components/EventCard";
import Navbar from "../components/Navbar";
import Footer from "../components/Footer";
import Socials from "../components/Socials";
import { Swiper, SwiperSlide } from "swiper/react";
import "swiper/css";
import "swiper/css/pagination";
import "swiper/css/navigation";
import { Autoplay, Pagination } from "swiper/modules";
import SponsorCard, { SponsorType } from "../components/SponsorCard";
import placeholder from "../assets/download.jpg";

// Temp Sponsors data
const sponsorData: SponsorType[] = [
{
name: "Sponsor 1",
description: "Sponsor 1 Description",
image: placeholder,
},
{
name: "Sponsor 2",
description: "Sponsor 2 Description",
image: placeholder,
},
{
name: "Sponsor 3",
description: "Sponsor 3 Description",
image: placeholder,
},
{
name: "Sponsor 4",
description: "Sponsor 4 Description",
image: placeholder,
},
{
name: "Sponsor 5",
description: "Sponsor 5 Description",
image: placeholder,
},
];

// Temp events data
const eventsData: EventType[] = [
{
id: 1,
date: "4",
month: "April",
title: "Meet and Greet",
description: "Come and meet your fellow peers and connect with each other",
},
{
id: 2,
date: "5",
month: "May",
title: "Event 2",
description: "Event 2 Description",
},
{
id: 3,
date: "17",
month: "June",
title: "June Party",
description: "UADS Party in June",
},
{
id: 4,
date: "6",
month: "July",
title: "Event 4",
description: "Description for Event 4",
},
{
id: 5,
date: "6",
month: "August",
title: "Event 5",
description: "Description for Event 5",
},
];

export default function Home() {
return (
<>
<Navbar />
<div className="container px-4 pt-24 mx-auto content-center">
<h1 className=" text-center text-3xl font-bold text-gray-900 sm:text-4xl dark:text-white">Home Page</h1>

<div className="max-w-screen bg-light-pink px-5 lg:px-10">
<div className="w-full flex flex-col md:flex-row justify-between items-center">
<img src={sundae} alt="Sundae Image" className="hidden md:block transform -rotate-12 opacity-50" />
<div className="w-full h-auto flex flex-col justify-center items-center font-bold font-raleway text-center py-10 md:py-20">
<img src={uadslogo} alt="UADS Logo" className="w-96" />
<h3 className="text-3xl text-brown">University of Auckland</h3>
<h1 className="text-7xl text-brown">Dessert Society</h1>
<br />
<h3 className="text-3xl text-pink">Where dessert lovers go to celebrate the art of eating and making desserts</h3>
<br />
<Socials background="bg-brown" hoverBackground="bg-pink" iconColor="text-light-pink" hoverIconColor="text-white" />
</div>
<img src={creamcup} alt="Cupcake Image" className="transform hidden md:block rotate-12 opacity-50" />
</div>
</div>

<div className="max-w-screen h-auto flex flex-col items-center py-4 px-5 md:px-10 lg:px-40 bg-pink">
<h1 className="text-4xl text-light-pink font-bold font-raleway text-center">Supported by our Sponsors</h1>

<div className="w-full h-auto mb-5">
<Swiper
slidesPerView={1}
spaceBetween={100}
loop={true}
centeredSlides={true}
pagination={{
clickable: true,
}}
autoplay={{
delay: 3000,
disableOnInteraction: false,
}}
modules={[Autoplay, Pagination]}
breakpoints={{
640: {
slidesPerView: 2,
spaceBetween: 250,
},
768: {
slidesPerView: 2,
spaceBetween: 200,
},
1024: {
slidesPerView: 2,
spaceBetween: 200,
},
1280: {
slidesPerView: 3,
spaceBetween: 300,
},
}}
className="mySwiper px-0 md:px-10 py-10"
>
{sponsorData.map((sponsor) => {
return (
<SwiperSlide>
<SponsorCard sponsor={sponsor} />
</SwiperSlide>
);
})}
</Swiper>
</div>

<NavLink to="/sponsors" className="group flex justify-center items-center bg-light-pink hover:bg-brown py-2 px-5 rounded-xl">
<p className="text-2xl text-brown font-bold font-raleway group-hover:text-light-pink">See More Sponsors</p>
</NavLink>
</div>

<div className="max-w-screen h-auto flex flex-col items-center py-4 px-5 md:px-10 lg:px-40 bg-brown">
<h1 className="text-4xl text-light-pink font-bold font-raleway text-center">Our Exciting Events</h1>

<div className="w-full h-auto mb-5">
<Swiper
slidesPerView={1}
spaceBetween={100}
loop={true}
centeredSlides={true}
pagination={{
clickable: true,
}}
autoplay={{
delay: 3000,
disableOnInteraction: false,
}}
modules={[Autoplay, Pagination]}
breakpoints={{
640: {
slidesPerView: 2,
spaceBetween: 250,
},
768: {
slidesPerView: 2,
spaceBetween: 200,
},
1024: {
slidesPerView: 2,
spaceBetween: 200,
},
1280: {
slidesPerView: 3,
spaceBetween: 300,
},
}}
className="mySwiper px-0 md:px-10 py-10"
>
{eventsData.map((event) => {
return (
<SwiperSlide>
<EventCard event={event} />
</SwiperSlide>
);
})}
</Swiper>
</div>

<NavLink to="/events" className="group flex justify-center items-center bg-light-pink hover:bg-pink py-2 px-5 rounded-xl">
<p className="text-2xl text-brown font-bold font-raleway group-hover:text-light-pink">See More Events</p>
</NavLink>
</div>

<div className="max-w-screen py-10 flex flex-col justify-center items-center bg-light-pink">
<h1 className="text-4xl text-brown font-bold font-raleway">Join UADS Today!</h1>

<NavLink to="/signup" className="flex justify-center items-center bg-pink hover:bg-brown py-2 px-16 my-5 rounded-xl">
<p className="text-2xl text-light-pink font-bold font-raleway">Join</p>
</NavLink>
</div>

<Footer />
</>
);
Expand Down
20 changes: 10 additions & 10 deletions web/src/pages/__tests__/Home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import "@testing-library/jest-dom";
* Test suite to test if the elements in the Home Page are rendered correctly
*/
describe("Home Page Rendering", () => {
it("Should display the Home page title", () => {
// Render the Home component in a simulated DOM
render(
<MemoryRouter>
<Home />
</MemoryRouter>
);
it("Should display the Home page title", () => {
// Render the Home component in a simulated DOM
render(
<MemoryRouter>
<Home />
</MemoryRouter>
);

const message = screen.getByText(/Home Page/i);
const message = screen.getByText(/Dessert Society/i);

expect(message).toBeInTheDocument();
});
expect(message).toBeInTheDocument();
});
});
3 changes: 2 additions & 1 deletion web/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export default {
'pink': '#B04F61',
'gray': '#3D3F4B',
'brown': '#472A25',
'yellow': '#FCBA04'
'yellow': '#FCBA04',
'light-brown': '#5F4444',
},
},
},
Expand Down
Loading
Loading