diff --git a/app/page.tsx b/app/page.tsx
index fb081c1e..111a1c18 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -4,14 +4,12 @@ import ProfilePage from "@/app/profiles/page";
export const dynamic = "force-dynamic"; // This disables SSG and ISR
-import Link from "next/link";
-
export default function HomePage() {
const profilePage = () => {
return (
-
+
)
}
@@ -38,7 +36,7 @@ export default function HomePage() {
BayesBond
- Tired of swiping? Just search what you are looking for!
+ Tired of swiping? Just search what you're looking for!
{profilePage()}
diff --git a/app/profiles/ProfileFilters.tsx b/app/profiles/ProfileFilters.tsx
index 69569c81..1d1d431f 100644
--- a/app/profiles/ProfileFilters.tsx
+++ b/app/profiles/ProfileFilters.tsx
@@ -223,11 +223,21 @@ export function ProfileFilters({filters, onFilterChange, onShowFilters, onToggle
max: number;
}
+ const rangeStates = Object.fromEntries(rangeConfig.map(({id}) => {
+ const [minVal, setMinVal] = useState
(undefined);
+ const [maxVal, setMaxVal] = useState(undefined);
+ return [id, {
+ minVal,
+ maxVal,
+ setMinVal,
+ setMaxVal,
+ }];
+ }))
+
function getSlider({id, name, min, max}: Range) {
const minStr = 'min' + capitalize(id);
const maxStr = 'max' + capitalize(id);
- const [minVal, setMinVal] = useState(undefined);
- const [maxVal, setMaxVal] = useState(undefined);
+ const {minVal, maxVal, setMinVal, setMaxVal} = rangeStates[id];
return (
@@ -295,52 +305,10 @@ export function ProfileFilters({filters, onFilterChange, onShowFilters, onToggle
)
}
- const [text, setText] = useState
('');
-
return (
- {showFilters && (
-
-
-
setText(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === 'Enter') {
- const value = (e.target as HTMLInputElement).value;
- onFilterChange('searchQuery', value);
- }
- }}
- />
- {filters.searchQuery && (
-
- )}
-
-
-
- )}
+ {/*{showFilters && ()}*/}