From 279948cb41acd237a7e7510ef3e8e3e57125903f Mon Sep 17 00:00:00 2001 From: Alexandra Date: Mon, 23 Nov 2026 10:39:14 +0100 Subject: [PATCH 1/5] Changed the order on the sidebar to be more logical and updated button to be a heart to fit with the title and updated tests --- .../src/components/heartIcon/HeartIcon.tsx | 23 +++ .../components/matchButton/MatchButton.css | 2 +- .../components/matchButton/MatchButton.tsx | 5 +- frontend/src/components/sidebar/Sidebar.css | 8 +- frontend/src/components/sidebar/Sidebar.tsx | 29 ++-- frontend/src/i18n/locales/en/translation.json | 8 +- frontend/src/i18n/locales/no/translation.json | 10 +- frontend/src/index.css | 2 - .../src/pages/plantMatch/PlantMatchPage.css | 99 +++++++++++-- .../src/pages/plantMatch/PlantMatchPage.tsx | 136 ++++++++++++++++-- frontend/src/tests/ExplorePlantsPage.test.tsx | 6 +- 11 files changed, 275 insertions(+), 53 deletions(-) create mode 100644 frontend/src/components/heartIcon/HeartIcon.tsx diff --git a/frontend/src/components/heartIcon/HeartIcon.tsx b/frontend/src/components/heartIcon/HeartIcon.tsx new file mode 100644 index 00000000..781663a1 --- /dev/null +++ b/frontend/src/components/heartIcon/HeartIcon.tsx @@ -0,0 +1,23 @@ +type HeartIconProps = { + className?: string; +}; + +// A filled heart drawn in SVG. It takes the text color (currentColor) and the +// font size (1em), so it can replace a text icon like ✿ without other changes. +// Hidden from screen readers, since the button around it has its own label. +export default function HeartIcon({ className }: HeartIconProps) { + return ( + + ); +} diff --git a/frontend/src/components/matchButton/MatchButton.css b/frontend/src/components/matchButton/MatchButton.css index bd2e06a7..64722382 100644 --- a/frontend/src/components/matchButton/MatchButton.css +++ b/frontend/src/components/matchButton/MatchButton.css @@ -31,7 +31,7 @@ visibility: visible; } -/* A filled dark pink button with a white flower (add) or X (remove) */ +/* A filled dark pink button with a white heart (add) or X (remove) */ .add-match-button { width: 56px; height: 56px; diff --git a/frontend/src/components/matchButton/MatchButton.tsx b/frontend/src/components/matchButton/MatchButton.tsx index 26b52695..bed291ae 100644 --- a/frontend/src/components/matchButton/MatchButton.tsx +++ b/frontend/src/components/matchButton/MatchButton.tsx @@ -1,4 +1,5 @@ import "./MatchButton.css"; +import HeartIcon from "../heartIcon/HeartIcon"; type MatchButtonProps = { isMatched: boolean; @@ -8,7 +9,7 @@ type MatchButtonProps = { className?: string; }; -// The round button on a plant card that adds the plant to My Matches (✿), or +// The round button on a plant card that adds the plant to My Matches (heart), or // removes it if it is already there (✖). It looks the same on every page. // Placed next to the card, not inside it, so there are no nested buttons. export default function MatchButton({ @@ -33,7 +34,7 @@ export default function MatchButton({ onClick={onClick} aria-label={label} > - {isMatched ? "✖" : "✿"} + {isMatched ? "✖" : }