From dbc98ad0f8fe2c9e5df229922b438ad11c837200 Mon Sep 17 00:00:00 2001
From: spwoodcock
Date: Mon, 9 Dec 2024 21:15:11 +0000
Subject: [PATCH] feat(frontend): add 'Start Mapping' call to action button on
homepage cards
---
.../components/home/ExploreProjectCard.tsx | 24 +++++++++++++++++++
src/frontend/src/store/slices/ThemeSlice.ts | 4 ++++
2 files changed, 28 insertions(+)
diff --git a/src/frontend/src/components/home/ExploreProjectCard.tsx b/src/frontend/src/components/home/ExploreProjectCard.tsx
index 55aad9d6ba..b7e03f9d70 100755
--- a/src/frontend/src/components/home/ExploreProjectCard.tsx
+++ b/src/frontend/src/components/home/ExploreProjectCard.tsx
@@ -49,6 +49,13 @@ export default function ExploreProjectCard({ data }: { data: projectType }) {
fontSize: 22,
},
},
+ button: {
+ marginTop: '1rem',
+ marginLeft: '2%',
+ padding: '0.5rem 1rem',
+ fontSize: defaultTheme.typography.h5.fontSize,
+ fontWeight: 'bold',
+ },
};
return (
@@ -101,6 +108,23 @@ export default function ExploreProjectCard({ data }: { data: projectType }) {
{data?.location_str}
+
+ {/* Start Mapping Button */}
+
+ {
+ // Prevent card click
+ e.stopPropagation();
+ // Redirect without opening new tab
+ window.location.href = `/mapnow/${data.id}`;
+ }}
+ >
+ Start Mapping
+
+
diff --git a/src/frontend/src/store/slices/ThemeSlice.ts b/src/frontend/src/store/slices/ThemeSlice.ts
index 961a44bc86..4abec835e4 100755
--- a/src/frontend/src/store/slices/ThemeSlice.ts
+++ b/src/frontend/src/store/slices/ThemeSlice.ts
@@ -140,6 +140,10 @@ const initialState: themeStateType = {
fontFamily: 'BarlowLight',
fontSize: 16,
},
+ h5: {
+ fontFamily: 'BarlowLight',
+ fontSize: 14,
+ },
p: {
fontFamily: 'Archivo',
fontSize: 16,