Added images in springboard

This commit is contained in:
2024-08-05 12:56:50 +08:00
parent 1792e9c629
commit 02a20ec78b
6 changed files with 13 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 KiB

BIN
client/assets/events.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 808 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 KiB

View File

@@ -4,10 +4,12 @@ import { useNavigate } from "react-router-dom";
export default function SpringboardButton({ export default function SpringboardButton({
title, title,
subtitle, subtitle,
imageSrc,
linkToPage, linkToPage,
}: { }: {
title: string; title: string;
subtitle: string; subtitle: string;
imageSrc: string;
linkToPage: string; linkToPage: string;
}) { }) {
const navigate = useNavigate(); const navigate = useNavigate();
@@ -16,9 +18,14 @@ export default function SpringboardButton({
onPress={() => { onPress={() => {
navigate(linkToPage); navigate(linkToPage);
}} }}
className="border-4 border-primary-500 bg-neutral-700 hover:bg-primary-500 text-white" className="relative border-4 border-primary-500 text-white p-0"
> >
<div className="flex flex-col justify-between w-full h-full py-4 px-2 text-left *:text-wrap mr-16"> <img
src={imageSrc}
alt={title}
className="absolute w-full h-full inset-0 object-cover brightness-50"
/>
<div className="relative flex flex-col justify-between w-full h-full py-4 px-6 text-left *:text-wrap transition-colors hover:bg-primary-500">
<p className="text-2xl font-semibold">{title}</p> <p className="text-2xl font-semibold">{title}</p>
<p>{subtitle}</p> <p>{subtitle}</p>
</div> </div>

View File

@@ -85,21 +85,25 @@ export default function SpringboardPage() {
<SpringboardButton <SpringboardButton
title="Community Forums" title="Community Forums"
subtitle="Be involved in discussions among your neighbourhood" subtitle="Be involved in discussions among your neighbourhood"
imageSrc="../assets/community-forums.png"
linkToPage="/community-posts" linkToPage="/community-posts"
></SpringboardButton> ></SpringboardButton>
<SpringboardButton <SpringboardButton
title="Events" title="Events"
subtitle="Participate in exciting upcoming events around Singapore" subtitle="Participate in exciting upcoming events around Singapore"
imageSrc="../assets/events.png"
linkToPage="/events" linkToPage="/events"
></SpringboardButton> ></SpringboardButton>
<SpringboardButton <SpringboardButton
title="Home Bill Contest" title="Home Bill Contest"
subtitle="Save resources, win vouchers!" subtitle="Save resources, win vouchers!"
imageSrc="../assets/home-bill-contest.png"
linkToPage="/home-bill-contest" linkToPage="/home-bill-contest"
></SpringboardButton> ></SpringboardButton>
<SpringboardButton <SpringboardButton
title="Karang Guni Scheduling" title="Karang Guni Scheduling"
subtitle="Arrange doorstep sales for your old gears with Karang Guni" subtitle="Arrange doorstep sales for your old gears with Karang Guni"
imageSrc="../assets/karang-guni.png"
linkToPage="/karang-guni-schedules" linkToPage="/karang-guni-schedules"
></SpringboardButton> ></SpringboardButton>
</div> </div>