Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Further Clean up status WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
acouch committed Jun 26, 2024
1 parent 307c2dd commit b14d9e0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions frontend/src/app/[locale]/look/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { QueryContext } from "./QueryProvider";
import { useContext } from "react";

interface SearchBarProps {
query: string;
query: string | null | undefined;
}

export default function SearchBar({ query }: SearchBarProps) {
Expand Down Expand Up @@ -46,7 +46,7 @@ export default function SearchBar({ query }: SearchBarProps) {
id="query"
type="search"
name="query"
defaultValue={query}
defaultValue={query || ""}
onChange={(e) => updateQueryTerm(e.target?.value)}
onKeyDown={(e) => {
if (e.key === 'Enter') {
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/app/[locale]/look/SearchOpportunityStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ export default function SearchOpportunityStatus({ selectedStatuses }: SearchOppo
const router = useRouter();
const statuses = Array.from(selectedStatuses).join(",");

// console.log(Array.from(selectedStatuses).join(","), statuses)

const updateAll = (statusValue: string, isChecked: boolean) => {
const params = new URLSearchParams(searchParams);
const currentStatus = params.get('status');
Expand Down
8 changes: 3 additions & 5 deletions frontend/src/app/[locale]/look/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ export default function Look({
}) {
unstable_setRequestLocale("en");
const t = useTranslations("Process");
const key = searchParams.toString()
const key = Object.entries(searchParams).join(',')
const convertedSearchParams = convertSearchParamsToProperTypes(searchParams);

const query = convertedSearchParams?.query || '';
const statuses = convertedSearchParams?.status || '';
const { query, status } = convertedSearchParams;

return (
<>
Expand All @@ -54,7 +52,7 @@ export default function Look({
</div>
<div className="grid-row grid-gap">
<div className="tablet:grid-col-4">
<SearchOpportunityStatus selectedStatuses={statuses} />
<SearchOpportunityStatus selectedStatuses={status} />
</div>
<div className="tablet:grid-col-8">
<Suspense key={key} fallback={<Loading />}>
Expand Down

0 comments on commit b14d9e0

Please sign in to comment.