From 226e8609754cfe7dcf4c95aed5ff50a6b606c2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eline=20J=C3=A5sund?= Date: Thu, 1 Oct 2026 21:15:31 +0200 Subject: [PATCH 1/3] feat: implement searchpage The searchpage now includes a searchbar and a filtermenue, that displayes filters and sorting options. Only one filter and one sorting option can be active at one time. --- src/css/searchpage.css | 72 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/src/css/searchpage.css b/src/css/searchpage.css index e69de29..4266c30 100644 --- a/src/css/searchpage.css +++ b/src/css/searchpage.css @@ -0,0 +1,72 @@ +.searchinput.MuiTextField-root { + background-color: var(--secondary-component-color); + border-color: var(--secondary-background-color); + display: flex; + width: min(30rem, calc(100% - 5rem)); + margin: 0; +} + +.searchinput .MuiOutlinedInput-root { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.searchinput .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline, +.searchinput .MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline, +.searchinput .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline { + border-color: var(--secondary-background-color); +} + +.searchbar { + display: flex; + align-items: center; + justify-content: center; + gap: 0; +} + +.filterbutton { + background-color: var(--primary-component-color); + border: 1px solid var(--secondary-background-color); + border-left: 0; + border-radius: 0 4px 4px 0; + height: 56px; + padding: 0 1rem; +} + +.filterbutton.is-active, +.filterbutton:active { + background-color: var(--secondary-background-color); +} + +.filtersection { + box-sizing: border-box; + display: flex; + flex-wrap: wrap; + border: 1px; + align-self: center; + justify-content: center; + gap: 0.5rem; + border-top: 0; + border-color: var(--secondary-background-color); + border-style: solid; + width: min(30rem, calc(100% - 5rem)); + padding: 1rem; +} + +.filtersection .MuiButtonGroup-root { + gap: 0.5rem; +} + +.filtersection .MuiButtonGroup-root .MuiButtonGroup-grouped { + border: 1px solid var(--secondary-background-color); + border-radius: 4px; +} + +.filtersection .MuiButtonGroup-root .MuiButtonGroup-grouped:not(:last-of-type) { + border-right: 1px solid var(--secondary-background-color); +} + +.filtersection .MuiButton-root.is-active { + background-color: var(--secondary-background-color); + color: var(--primary-background-color); +} \ No newline at end of file From 186575edac44711d38b16302d385b4e27ff2907c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eline=20J=C3=A5sund?= Date: Thu, 1 Oct 2026 21:15:46 +0200 Subject: [PATCH 2/3] style: implement searchpage css --- src/pages/searchpage.tsx | 71 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/src/pages/searchpage.tsx b/src/pages/searchpage.tsx index 67315d2..6c188c9 100644 --- a/src/pages/searchpage.tsx +++ b/src/pages/searchpage.tsx @@ -1,9 +1,78 @@ import '../css/searchpage.css' +import Header from "../components/header"; +import Footer from "../components/footer"; +import { TextField, Button, ButtonGroup } from '@mui/material'; +import { Funnel } from 'lucide-react'; +import { useState } from 'react'; + export function SearchPage() { + const [isFilterActive, setIsFilterActive] = useState(false) + const [activeSortingButton, setActiveSortingButton] = useState(null) + const [activeFilterButton, setActiveFilterButton] = useState(null) + + const sortingbuttons = ["Sorting", "Sorting", "Sorting"] + const filterbuttons = ["Filter", "Filter", "Filter"] + + const toggleActive = () => setIsFilterActive((isActive) => !isActive) + const toggleSortingButton = (index: number) => { + setActiveSortingButton((activeIndex) => activeIndex === index ? null : index) + } + const toggleFilterButton = (index: number) => { + setActiveFilterButton((activeIndex) => activeIndex === index ? null : index) + } + return ( -
+
+
+

Searchpage

+ +
+ + +
+ + {isFilterActive && ( +
+ +

Sort by:

+ {sortingbuttons.map((button, index) => ( + + ))} +
+ + +

Filter by:

+ {filterbuttons.map((button, index) => ( + + ))} +
+
+ )} +
) } From 25089a05eb461341a11628554b5232713cb924be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eline=20J=C3=A5sund?= Date: Fri, 2 Oct 2026 08:20:26 +0200 Subject: [PATCH 3/3] feat: add placeholder to searchbar --- src/pages/searchpage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/searchpage.tsx b/src/pages/searchpage.tsx index 6c188c9..9ebe771 100644 --- a/src/pages/searchpage.tsx +++ b/src/pages/searchpage.tsx @@ -29,7 +29,7 @@ export function SearchPage() {

Searchpage

- +