@@ -10,7 +10,7 @@ import {RelationshipFilter, RelationshipFilterText,} from './relationship-filter
1010import { MyMatchesToggle } from './my-matches-toggle'
1111import { Profile } from 'common/profiles/profile'
1212import { Gender } from 'common/gender'
13- import { DietType , RelationshipType , RomanticType } from 'web/lib/util/convert-types'
13+ import { DietType , PoliticalType , RelationshipType , RomanticType } from 'web/lib/util/convert-types'
1414import { FilterFields } from "common/filters" ;
1515import { ShortBioToggle } from "web/components/filters/short-bio-toggle" ;
1616import { PrefGenderFilter , PrefGenderFilterText } from "./pref-gender-filter"
@@ -21,6 +21,7 @@ import {HasKidsFilter, HasKidsLabel} from "./has-kids-filter"
2121import { hasKidsLabels } from "common/has-kids" ;
2222import { RomanticFilter , RomanticFilterText } from "web/components/filters/romantic-filter" ;
2323import { DietFilter , DietFilterText } from "web/components/filters/diet-filter" ;
24+ import { PoliticalFilter , PoliticalFilterText } from "web/components/filters/political-filter" ;
2425
2526function MobileFilters ( props : {
2627 filters : Partial < FilterFields >
@@ -188,74 +189,94 @@ function MobileFilters(props: {
188189 < RomanticFilter filters = { filters } updateFilter = { updateFilter } />
189190 </ MobileFilterSection >
190191
191- { /* WANTS KIDS */ }
192- < MobileFilterSection
193- title = "Wants kids"
194- openFilter = { openFilter }
195- setOpenFilter = { setOpenFilter }
196- isActive = {
197- filters . wants_kids_strength != null &&
198- filters . wants_kids_strength !== - 1
199- }
200- icon = { < WantsKidsIcon strength = { filters . wants_kids_strength ?? - 1 } /> }
201- selection = {
202- < KidsLabel
203- strength = { filters . wants_kids_strength ?? - 1 }
204- highlightedClass = {
205- ( filters . wants_kids_strength ?? - 1 ) ==
206- wantsKidsLabels . no_preference . strength
207- ? 'text-ink-900'
208- : 'text-primary-600'
209- }
210- mobile
211- />
212- }
213- >
214- < WantsKidsFilter filters = { filters } updateFilter = { updateFilter } />
215- </ MobileFilterSection >
192+ { /* WANTS KIDS */ }
193+ < MobileFilterSection
194+ title = "Wants kids"
195+ openFilter = { openFilter }
196+ setOpenFilter = { setOpenFilter }
197+ isActive = {
198+ filters . wants_kids_strength != null &&
199+ filters . wants_kids_strength !== - 1
200+ }
201+ icon = { < WantsKidsIcon strength = { filters . wants_kids_strength ?? - 1 } /> }
202+ selection = {
203+ < KidsLabel
204+ strength = { filters . wants_kids_strength ?? - 1 }
205+ highlightedClass = {
206+ ( filters . wants_kids_strength ?? - 1 ) ==
207+ wantsKidsLabels . no_preference . strength
208+ ? 'text-ink-900'
209+ : 'text-primary-600'
210+ }
211+ mobile
212+ />
213+ }
214+ >
215+ < WantsKidsFilter filters = { filters } updateFilter = { updateFilter } />
216+ </ MobileFilterSection >
216217
217- { /* HAS KIDS */ }
218+ { /* HAS KIDS */ }
219+ < MobileFilterSection
220+ title = "Has kids"
221+ openFilter = { openFilter }
222+ setOpenFilter = { setOpenFilter }
223+ isActive = { filters . has_kids != null && filters . has_kids !== - 1 }
224+ icon = { < FaChild className = "text-ink-900 h-4 w-4" /> }
225+ selection = {
226+ < HasKidsLabel
227+ has_kids = { filters . has_kids ?? - 1 }
228+ highlightedClass = {
229+ ( filters . has_kids ?? - 1 ) == hasKidsLabels . no_preference . value
230+ ? 'text-ink-900'
231+ : 'text-primary-600'
232+ }
233+ mobile
234+ />
235+ }
236+ >
237+ < HasKidsFilter filters = { filters } updateFilter = { updateFilter } />
238+ </ MobileFilterSection >
239+
240+ </ > }
241+
242+ { /* DIET */ }
218243 < MobileFilterSection
219- title = "Has kids "
244+ title = "Diet "
220245 openFilter = { openFilter }
221246 setOpenFilter = { setOpenFilter }
222- isActive = { filters . has_kids != null && filters . has_kids !== - 1 }
223- icon = { < FaChild className = "text-ink-900 h-4 w-4" /> }
247+ isActive = { hasAny ( filters . diet || undefined ) }
224248 selection = {
225- < HasKidsLabel
226- has_kids = { filters . has_kids ?? - 1 }
249+ < DietFilterText
250+ options = { filters . diet as DietType [ ] }
227251 highlightedClass = {
228- ( filters . has_kids ?? - 1 ) == hasKidsLabels . no_preference . value
229- ? 'text-ink-900 '
230- : 'text-primary-600 '
252+ hasAny ( filters . diet || undefined )
253+ ? 'text-primary-600 '
254+ : 'text-ink-900 '
231255 }
232- mobile
233256 />
234257 }
235258 >
236- < HasKidsFilter filters = { filters } updateFilter = { updateFilter } />
259+ < DietFilter filters = { filters } updateFilter = { updateFilter } />
237260 </ MobileFilterSection >
238261
239- </ > }
240-
241- { /* DIET */ }
262+ { /* POLITICS */ }
242263 < MobileFilterSection
243- title = "Diet "
264+ title = "Politics "
244265 openFilter = { openFilter }
245266 setOpenFilter = { setOpenFilter }
246- isActive = { hasAny ( filters . diet || undefined ) }
267+ isActive = { hasAny ( filters . political_beliefs || undefined ) }
247268 selection = {
248- < DietFilterText
249- options = { filters . diet as DietType [ ] }
269+ < PoliticalFilterText
270+ options = { filters . political_beliefs as PoliticalType [ ] }
250271 highlightedClass = {
251- hasAny ( filters . diet || undefined )
272+ hasAny ( filters . political_beliefs || undefined )
252273 ? 'text-primary-600'
253274 : 'text-ink-900'
254275 }
255276 />
256277 }
257278 >
258- < DietFilter filters = { filters } updateFilter = { updateFilter } />
279+ < PoliticalFilter filters = { filters } updateFilter = { updateFilter } />
259280 </ MobileFilterSection >
260281
261282 { /* Short Bios */ }
0 commit comments