Skip to content

Commit f974eba

Browse files
committed
Move Reset filter to top
1 parent 7d7969f commit f974eba

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

web/components/filters/mobile-filters.tsx

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,22 @@ function MobileFilters(props: {
5959

6060
return (
6161
<Col>
62-
<Col className="p-4 pb-2">
63-
<MyMatchesToggle
64-
setYourFilters={setYourFilters}
65-
youProfile={youProfile}
66-
on={isYourFilters}
67-
hidden={!youProfile}
68-
/>
69-
</Col>
62+
<Row>
63+
<Col className="p-4 pb-2">
64+
<MyMatchesToggle
65+
setYourFilters={setYourFilters}
66+
youProfile={youProfile}
67+
on={isYourFilters}
68+
hidden={!youProfile}
69+
/>
70+
</Col>
71+
<button
72+
className="text-ink-500 hover:text-primary-500 underline mt-4 mb-8 right absolute right-4"
73+
onClick={clearFilters}
74+
>
75+
Reset filters
76+
</button>
77+
</Row>
7078

7179
{/* RELATIONSHIP STYLE */}
7280
<MobileFilterSection
@@ -266,16 +274,22 @@ function MobileFilters(props: {
266274
title="Drinks"
267275
openFilter={openFilter}
268276
setOpenFilter={setOpenFilter}
269-
isActive={(() => { const [noMin, noMax] = getNoMinMaxDrinks(filters.drinks_min, filters.drinks_max); return !noMin || !noMax })()}
277+
isActive={(() => {
278+
const [noMin, noMax] = getNoMinMaxDrinks(filters.drinks_min, filters.drinks_max);
279+
return !noMin || !noMax
280+
})()}
270281
selection={
271282
<DrinksFilterText
272283
drinks_min={filters.drinks_min}
273284
drinks_max={filters.drinks_max}
274-
highlightedClass={(() => { const [noMin, noMax] = getNoMinMaxDrinks(filters.drinks_min, filters.drinks_max); return (noMin && noMax) ? 'text-ink-900' : 'text-primary-600' })()}
285+
highlightedClass={(() => {
286+
const [noMin, noMax] = getNoMinMaxDrinks(filters.drinks_min, filters.drinks_max);
287+
return (noMin && noMax) ? 'text-ink-900' : 'text-primary-600'
288+
})()}
275289
/>
276290
}
277291
>
278-
<DrinksFilter filters={filters} updateFilter={updateFilter} />
292+
<DrinksFilter filters={filters} updateFilter={updateFilter}/>
279293
</MobileFilterSection>
280294

281295
{/* SMOKER */}
@@ -292,7 +306,7 @@ function MobileFilters(props: {
292306
/>
293307
}
294308
>
295-
<SmokerFilter filters={filters} updateFilter={updateFilter} />
309+
<SmokerFilter filters={filters} updateFilter={updateFilter}/>
296310
</MobileFilterSection>
297311

298312
{/* POLITICS */}
@@ -341,13 +355,6 @@ function MobileFilters(props: {
341355
hidden={false}
342356
/>
343357
</Col>
344-
345-
<button
346-
className="text-ink-500 hover:text-primary-500 underline mt-4 mb-8"
347-
onClick={clearFilters}
348-
>
349-
Reset filters
350-
</button>
351358
</Col>
352359
)
353360
}

0 commit comments

Comments
 (0)