Skip to content

Commit

Permalink
Feat/drizzle initial load workaround (#273)
Browse files Browse the repository at this point in the history
* Consolidate settings and dashboard pages (#211)

* remove old account/setting page

* bug fix: open nested pages within an outlet

* move 'my devices dashboard' to profile + update styles

* hide device id and update dashboard style

* add navbar to device overview and tranfer pages

* some updates

* make settings->profile as  a defualt page

* add header to navbar

* bug fix: selecting route that is already selected from sidebar

* separate sidebarNav from sidebarSettingsNav

* update dark mode style

* some updates

* update sidebar (dark mode)

* Bump @vitest/coverage-v8 from 0.34.5 to 0.34.6 (#224)

Bumps [@vitest/coverage-v8](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-v8) from 0.34.5 to 0.34.6.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v0.34.6/packages/coverage-v8)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-v8"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump i18next-http-backend from 2.2.0 to 2.3.1 (#229)

Bumps [i18next-http-backend](https://github.com/i18next/i18next-http-backend) from 2.2.0 to 2.3.1.
- [Changelog](https://github.com/i18next/i18next-http-backend/blob/master/CHANGELOG.md)
- [Commits](i18next/i18next-http-backend@v2.2.0...v2.3.1)

---
updated-dependencies:
- dependency-name: i18next-http-backend
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @testing-library/cypress from 9.0.0 to 10.0.1 (#230)

Bumps [@testing-library/cypress](https://github.com/kentcdodds/cypress-testing-library) from 9.0.0 to 10.0.1.
- [Release notes](https://github.com/kentcdodds/cypress-testing-library/releases)
- [Changelog](https://github.com/testing-library/cypress-testing-library/blob/main/CHANGELOG.md)
- [Commits](testing-library/cypress-testing-library@v9.0.0...v10.0.1)

---
updated-dependencies:
- dependency-name: "@testing-library/cypress"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @types/geojson from 7946.0.10 to 7946.0.12 (#232)

Bumps [@types/geojson](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/geojson) from 7946.0.10 to 7946.0.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/geojson)

---
updated-dependencies:
- dependency-name: "@types/geojson"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump react-day-picker from 8.9.0 to 8.9.1 (#231)

Bumps [react-day-picker](https://github.com/gpbl/react-day-picker) from 8.9.0 to 8.9.1.
- [Release notes](https://github.com/gpbl/react-day-picker/releases)
- [Commits](gpbl/react-day-picker@v8.9.0...v8.9.1)

---
updated-dependencies:
- dependency-name: react-day-picker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* refactor filters (#227)

* start refactoring

* fix TypeScript error

* Bump @conform-to/react from 0.9.0 to 0.9.1 (#236)

Bumps [@conform-to/react](https://github.com/edmundhung/conform/tree/HEAD/packages/conform-react) from 0.9.0 to 0.9.1.
- [Release notes](https://github.com/edmundhung/conform/releases)
- [Commits](https://github.com/edmundhung/conform/commits/v0.9.1/packages/conform-react)

---
updated-dependencies:
- dependency-name: "@conform-to/react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump @radix-ui/react-alert-dialog from 1.0.4 to 1.0.5 (#233)

* Bump @radix-ui/react-alert-dialog from 1.0.4 to 1.0.5

Bumps [@radix-ui/react-alert-dialog](https://github.com/radix-ui/primitives) from 1.0.4 to 1.0.5.
- [Changelog](https://github.com/radix-ui/primitives/blob/main/release-process.md)
- [Commits](https://github.com/radix-ui/primitives/commits)

---
updated-dependencies:
- dependency-name: "@radix-ui/react-alert-dialog"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* fix TS error

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: freds-dev <[email protected]>

* Feat/mqtt check connection (#209)

* mqtt check url connection

* some updates

* show success msg after connection with mqtt url

* update getting mqtt url value

* update mqtt naming

* update check mqtt conn. to accept mqtt/mqtts

* rename dashboard page

* update `package-lock.json`

---------

Co-authored-by: freds-dev <[email protected]>

* Bump @hookform/resolvers from 3.3.1 to 3.3.2 (#241)

Bumps [@hookform/resolvers](https://github.com/react-hook-form/resolvers) from 3.3.1 to 3.3.2.
- [Release notes](https://github.com/react-hook-form/resolvers/releases)
- [Commits](react-hook-form/resolvers@v3.3.1...v3.3.2)

---
updated-dependencies:
- dependency-name: "@hookform/resolvers"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump lucide-react from 0.263.1 to 0.293.0 (#240)

Bumps [lucide-react](https://github.com/lucide-icons/lucide/tree/HEAD/packages/lucide-react) from 0.263.1 to 0.293.0.
- [Release notes](https://github.com/lucide-icons/lucide/releases)
- [Commits](https://github.com/lucide-icons/lucide/commits/0.293.0/packages/lucide-react)

---
updated-dependencies:
- dependency-name: lucide-react
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cypress from 13.3.1 to 13.6.0 (#244)

Bumps [cypress](https://github.com/cypress-io/cypress) from 13.3.1 to 13.6.0.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v13.3.1...v13.6.0)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump clsx from 1.2.1 to 2.0.0 (#243)

Bumps [clsx](https://github.com/lukeed/clsx) from 1.2.1 to 2.0.0.
- [Release notes](https://github.com/lukeed/clsx/releases)
- [Commits](lukeed/clsx@v1.2.1...v2.0.0)

---
updated-dependencies:
- dependency-name: clsx
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cookie from 0.5.0 to 0.6.0 (#246)

Bumps [cookie](https://github.com/jshttp/cookie) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/jshttp/cookie/releases)
- [Changelog](https://github.com/jshttp/cookie/blob/master/HISTORY.md)
- [Commits](jshttp/cookie@v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: cookie
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cypress from 13.6.0 to 13.6.1 (#247)

Bumps [cypress](https://github.com/cypress-io/cypress) from 13.6.0 to 13.6.1.
- [Release notes](https://github.com/cypress-io/cypress/releases)
- [Changelog](https://github.com/cypress-io/cypress/blob/develop/CHANGELOG.md)
- [Commits](cypress-io/cypress@v13.6.0...v13.6.1)

---
updated-dependencies:
- dependency-name: cypress
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix lint errors

* comment out devicesDashboard for now and ugly fixes to make ts happy

* lint error

* remove duplicate package

* Bump prettier from 3.0.3 to 3.1.1 (#250)

Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](prettier/prettier@3.0.3...3.1.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump prettier-plugin-tailwindcss from 0.5.4 to 0.5.11 (#253)

Bumps [prettier-plugin-tailwindcss](https://github.com/tailwindlabs/prettier-plugin-tailwindcss) from 0.5.4 to 0.5.11.
- [Release notes](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/releases)
- [Changelog](https://github.com/tailwindlabs/prettier-plugin-tailwindcss/blob/main/CHANGELOG.md)
- [Commits](tailwindlabs/prettier-plugin-tailwindcss@v0.5.4...v0.5.11)

---
updated-dependencies:
- dependency-name: prettier-plugin-tailwindcss
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* distinguish request with/without phenomenon

* update drizzle-orm version

* update `drizzle-kit` to latest

* deploy all PR images

* change Dockerfile from prisma to drizzle

* try to fix build

* revert Dockerfile changes

* edit Dockerfile for drizzle orm

* seed database

* seed database

* remove seed script

* fix(drizzle): set `SSL` option on postgres client (#276)

* fix: set SSL property in env file

* add missing env module

* fix typeof `PG_CLIENT_SSL`

* remove migration from Dockerfile

* TS type error fix

---------

Co-authored-by: freds-dev <[email protected]>

* pretty `MyDevice` section

* fix badges on profile page

* fix profile image related things

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Yousef Qamaz <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: jona159 <[email protected]>
Co-authored-by: Matthias Pfeil <[email protected]>
  • Loading branch information
5 people authored Mar 17, 2024
1 parent e243627 commit d3114db
Show file tree
Hide file tree
Showing 49 changed files with 1,872 additions and 1,759 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"
# SHADOW_DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres"

PG_CLIENT_SSL="false"

SESSION_SECRET="super-duper-s3cret"

MAPBOX_ACCESS_TOKEN=""
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
build:
name: 🐳 Build
# only build/deploy main branch on pushes
if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }}
# if: ${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') && github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ node_modules
/pgdata

/app/styles/**/*.css

measurements.csv
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ FROM base as build
WORKDIR /myapp

COPY --from=deps /myapp/node_modules /myapp/node_modules

ADD prisma .
RUN npx prisma generate

ADD . .

RUN npm run drizzle:generate
#RUN npm run drizzle:migrate
RUN npm run build

# Finally, build the production image with minimal footprint
Expand All @@ -43,10 +42,10 @@ FROM base
WORKDIR /myapp

COPY --from=production-deps /myapp/node_modules /myapp/node_modules
COPY --from=build /myapp/node_modules/.prisma /myapp/node_modules/.prisma
#COPY --from=build /myapp/node_modules/.prisma /myapp/node_modules/.prisma

COPY --from=build /myapp/build /myapp/build
COPY --from=build /myapp/public /myapp/public
ADD . .

CMD ["npm", "start"]
CMD ["npm", "start"]
17 changes: 7 additions & 10 deletions app/components/header/menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ export default function Menu() {
</DropdownMenuItem>
)}

<Link to="/account/mydevices">
<DropdownMenuItem className=" cursor-pointer">
<Cpu className="mr-2 h-5 w-5" />
<span>{t("my_devices_label")}</span>
</DropdownMenuItem>
</Link>

<Link to="/settings/account">
<DropdownMenuItem className=" cursor-pointer">
Expand All @@ -174,10 +168,13 @@ export default function Menu() {
</DropdownMenuItem>
</Link>

<DropdownMenuItem>
<Cpu className="mr-2 h-5 w-5" />
<Link to="/profile/me">{t("my_devices_label")}</Link>
</DropdownMenuItem>
<Link to="/profile/me">
<DropdownMenuItem className=" cursor-pointer">
<Cpu className="mr-2 h-5 w-5" />
<span>{t("my_devices_label")}</span>
</DropdownMenuItem>
</Link>

<Link to="/device/new" target="_blank">
<DropdownMenuItem>
<PlusCircle className="mr-2 h-5 w-5" />
Expand Down
196 changes: 45 additions & 151 deletions app/components/header/nav-bar/filter-options/filter-options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,221 +5,115 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { useSearchParams, useNavigation } from "@remix-run/react";
import {
useSearchParams,
useNavigation,
useLoaderData,
} from "@remix-run/react";
import { X } from "lucide-react";
import { useState, useContext } from "react";
import { useEffect, useState } from "react";
import { Button } from "~/components/ui/button";
import { Label } from "~/components/ui/label";
import { getFilteredDevices } from "~/utils";
import Spinner from "../../../spinner";
import { Separator } from "~/components/ui/separator";
import invariant from "tiny-invariant";
import { FilterOptionsContext } from "~/routes/explore";

interface FilterOptionsProps {
devices: any;
}

//*************************************
export default function FilterOptions({ devices }: FilterOptionsProps) {
//* Use filtered devices in parent page (explore)
const {
filterOptionsOn,
setFilterOptionsOn,
GlobalFilteredDevices,
setGlobalFilteredDevices,
} = useContext(FilterOptionsContext);
import type { loader } from "~/routes/explore";

export default function FilterOptions() {
const data = useLoaderData<typeof loader>();
//* searchParams hook
const [searchParams, setSearchParams] = useSearchParams();
const navigation = useNavigation();
// To show more phenomena options
const [seeMorePhenomena, setSeeMorePhenomena] = useState(false);

//* Set initial filter params based on url Search Params
const [exposureVal, setExposureVal] = useState(
searchParams.has("exposure")
? searchParams.get("exposure") || undefined
: "all",
searchParams.get("exposure") ?? null,
);
const [statusVal, setStatusVal] = useState(
searchParams.has("status")
? searchParams.get("status") || undefined
: "all",
searchParams.get("status") ?? null,
);
const [phenomenonVal, setPhenomenonVal] = useState(
searchParams.has("phenomenon")
? searchParams.get("phenomenon") || undefined
: "all",
);
invariant(
typeof phenomenonVal === "string",
"phenomenonVal must be a string",
);

//* To show total number of shown devices
const [totalDevices, setTotalDevices] = useState(
filterOptionsOn
? (GlobalFilteredDevices as any).features.length
: devices.features.length,
const [, setPhenomenonVal] = useState(
searchParams.get("phenomenon") ?? null,
);

//*************************
//* Triggered when filter param is changed
function filterDevices() {
// setGlobalFilterParams(searchParams);
const filteredDevices = getFilteredDevices(devices, searchParams);
setFilterOptionsOn(true);
setGlobalFilteredDevices(filteredDevices);
setTotalDevices(filteredDevices.features.length);
}

//*************************
//* To reset search params to default (show all devices)
function onFilterOptionsReset() {
setTotalDevices(devices.features.length);
setGlobalFilteredDevices(devices);

setExposureVal("all");
setStatusVal("all");
setPhenomenonVal("all");
}
//* Update filter params based on url Search Params
useEffect(() => {
setExposureVal(searchParams.get("exposure") ?? null);
setStatusVal(searchParams.get("status") ?? null);
setPhenomenonVal(searchParams.get("phenomenon") ?? null);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [searchParams]);

return (
<div className="mt-[8px] space-y-3 px-3 py-[3px] dark:text-zinc-200">
<div className="mt-[8px] space-y-3 px-3 py-1 dark:text-zinc-200 flex flex-col justify-around h-full">
{navigation.state === "loading" && (
<div className="bg-white/30 dark:bg-zinc-800/30 absolute inset-0 z-50 flex items-center justify-center backdrop-blur-sm">
<Spinner />
</div>
)}
<div className="space-y-2">
<div className="space-y-[2px]">
<Label className=" text-base">Exposure: </Label>
<Label className="text-base">Exposure: </Label>
&nbsp;
<Select
value={exposureVal}
value={exposureVal ?? undefined}
onValueChange={(value) => {
setExposureVal(value.toLocaleLowerCase());
searchParams.set("exposure", value.toLocaleLowerCase());
filterDevices();
if (value === "all") {
searchParams.delete("exposure");
} else {
searchParams.set("exposure", value);
}
setSearchParams(searchParams);
}}
>
<SelectTrigger className="h-6 w-full border-4 text-base dark:border-zinc-800">
<SelectValue className="h-6" placeholder="all" />
<SelectValue className="h-6">{exposureVal ?? "---"}</SelectValue>
</SelectTrigger>
<SelectContent className="">
<SelectContent>
<SelectItem value="all">all</SelectItem>
<SelectItem value="indoor">indoor</SelectItem>
<SelectItem value="outdoor">outdoor</SelectItem>
<SelectItem value="mobile">mobile</SelectItem>
<SelectItem value="unknown">unknown</SelectItem>
</SelectContent>
</Select>
</div>
<div className="space-y-[2px]">
<Label className=" text-base">Status: </Label>
<Label className="text-base">Status: </Label>
&nbsp;
<Select
value={statusVal}
value={statusVal ?? undefined}
onValueChange={(value) => {
setStatusVal(value.toLocaleLowerCase());
searchParams.set("status", value.toLocaleLowerCase());
filterDevices();
if (value === "all") {
searchParams.delete("status");
} else {
searchParams.set("status", value);
}
setSearchParams(searchParams);
}}
>
<SelectTrigger className="h-6 w-full text-base">
<SelectValue className="h-6" placeholder="all" />
<SelectValue className="h-6">{statusVal ?? "---"}</SelectValue>
</SelectTrigger>
<SelectContent className="">
<SelectContent>
<SelectItem value="all">all</SelectItem>
<SelectItem value="active">active</SelectItem>
<SelectItem value="inactive">inactive</SelectItem>
<SelectItem value="old">old</SelectItem>
</SelectContent>
</Select>
</div>
<div className="space-y-[2px]">
<Label className=" text-base">Phenomenon: </Label>
&nbsp;
<Select
value={phenomenonVal}
onValueChange={(value) => {
setPhenomenonVal(value.toLocaleLowerCase());
searchParams.set("phenomenon", value.toLocaleLowerCase());
filterDevices();
setSearchParams(searchParams);
}}
>
<SelectTrigger className="h-6 wg-full text-base">
<SelectValue className="h-6" placeholder="all" />
</SelectTrigger>
<SelectContent className="">
<SelectItem value="all">all</SelectItem>
<SelectItem value="Temperatur">Temperatur</SelectItem>
<SelectItem value="Helligkeit">Helligkeit</SelectItem>
<SelectItem value="PM10">PM10</SelectItem>
<SelectItem value="PM2.5">PM2.5</SelectItem>
<SelectItem value="Luftdruck">Luftdruck</SelectItem>
<SelectItem value="Luftfeuchtigkeit">Luftfeuchtigkeit</SelectItem>
{!seeMorePhenomena &&
![
"Radioactivity",
"08A Pressure BME680",
"08A Temperature SHT31 flex",
].includes(phenomenonVal) && (
<>
<Separator />
<button
className="py-1.5 pl-8 pr-2 text-sm"
onClick={() => {
setSeeMorePhenomena(true);
}}
>
See More
</button>
</>
)}

{(seeMorePhenomena ||
[
"Radioactivity",
"08A Pressure BME680",
"08A Temperature SHT31 flex",
].includes(phenomenonVal)) && (
<>
<SelectItem value="Radioactivity">Radioactivity</SelectItem>
<SelectItem value="08A Pressure BME680">
08A Pressure BME680
</SelectItem>
<SelectItem value="08A Temperature BME680">
08A Temperature BME680
</SelectItem>
<SelectItem value="08A Temperature SHT31 flex">
08A Temperature SHT31
</SelectItem>
</>
)}
</SelectContent>
</Select>
</div>
</div>

<div className="flex justify-between">
<Label className="rounded-[5px] border-[1px] border-[#e2e8f0] px-2 py-[1px] text-base leading-[2.2]">
Results ({totalDevices})
Results {data.filteredDevices.features.length}
</Label>

<Button
variant="outline"
className=" px-2 py-[1px] text-base rounded-[5px] border-[1px] border-[#e2e8f0]"
onClick={() => {
onFilterOptionsReset();
searchParams.set("exposure", "all");
searchParams.set("status", "all");
searchParams.set("phenomenon", "all");
searchParams.delete("exposure");
searchParams.delete("status");
searchParams.delete("phenomenon");
setSearchParams(searchParams);
setFilterOptionsOn(false);
}}
>
<span>
Expand All @@ -230,4 +124,4 @@ export default function FilterOptions({ devices }: FilterOptionsProps) {
</div>
</div>
);
}
}
2 changes: 1 addition & 1 deletion app/components/header/nav-bar/nav-bar-handler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function getSections(devices: Device[]) {
title: "Filter",
icon: Filter,
color: "bg-gray-300",
component: <FilterOptions devices={devices}></FilterOptions>,
component: <FilterOptions></FilterOptions>,
},
{
title: "Phänomen",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export function PhenomenonSelect() {
// const [phenomenon, setPhenomenon] = useState<string | undefined>("all");
const [searchParams, setSearchParams] = useSearchParams();
const [phenomenonVal, setPhenomenonVal] = useState(
searchParams.has("mapPheno")
? searchParams.get("mapPheno") || undefined
searchParams.has("phenomenon")
? searchParams.get("phenomenon") || undefined
: "all",
);
// const [seeMorePhenomena, setSeeMorePhenomena] = useState(false);
Expand All @@ -46,7 +46,7 @@ export function PhenomenonSelect() {
value={phenomenonVal}
onValueChange={(value) => {
setPhenomenonVal(value);
searchParams.set("mapPheno", value);
searchParams.set("phenomenon", value);
setSearchParams(searchParams);
}}
>
Expand Down
Loading

0 comments on commit d3114db

Please sign in to comment.