Skip to content

Commit 70c9ec1

Browse files
committed
Show full political names
1 parent 2bcbbc9 commit 70c9ec1

3 files changed

Lines changed: 24 additions & 18 deletions

File tree

web/components/filters/choices.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,30 @@ export const ROMANTIC_CHOICES = {
1111
'Open Relationship': 'open',
1212
};
1313

14+
export const POLITICAL_CHOICES = {
15+
Progressive: 'progressive',
16+
Liberal: 'liberal',
17+
'Moderate / Centrist': 'moderate',
18+
Conservative: 'conservative',
19+
Socialist: 'socialist',
20+
Nationalist: 'nationalist',
21+
Populist: 'populist',
22+
'Green / Eco-Socialist': 'green',
23+
Technocratic: 'technocratic',
24+
Libertarian: 'libertarian',
25+
'Effective Accelerationism': 'e/acc',
26+
'Pause AI / Tech Skeptic': 'pause ai',
27+
'Independent / Other': 'other',
28+
}
29+
1430
export const REVERTED_RELATIONSHIP_CHOICES = Object.fromEntries(
1531
Object.entries(RELATIONSHIP_CHOICES).map(([key, value]) => [value, key])
1632
);
1733

1834
export const REVERTED_ROMANTIC_CHOICES = Object.fromEntries(
1935
Object.entries(ROMANTIC_CHOICES).map(([key, value]) => [value, key])
36+
);
37+
38+
export const REVERTED_POLITICAL_CHOICES = Object.fromEntries(
39+
Object.entries(POLITICAL_CHOICES).map(([key, value]) => [value, key])
2040
);

web/components/optional-profile-form.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {City, CityRow, profileToCity, useCitySearch} from "web/components/search
2828
import {AddPhotosWidget} from './widgets/add-photos'
2929
import {RadioToggleGroup} from "web/components/widgets/radio-toggle-group";
3030
import {MultipleChoiceOptions} from "common/love/multiple-choice";
31-
import {RELATIONSHIP_CHOICES, ROMANTIC_CHOICES} from "web/components/filters/choices";
31+
import {POLITICAL_CHOICES, RELATIONSHIP_CHOICES, ROMANTIC_CHOICES} from "web/components/filters/choices";
3232
import toast from "react-hot-toast";
3333

3434
export const OptionalLoveUserForm = (props: {
@@ -393,21 +393,7 @@ export const OptionalLoveUserForm = (props: {
393393
<Col className={clsx(colClassName)}>
394394
<label className={clsx(labelClassName)}>Political beliefs</label>
395395
<MultiCheckbox
396-
choices={{
397-
Progressive: 'progressive',
398-
Liberal: 'liberal',
399-
'Moderate / Centrist': 'moderate',
400-
Conservative: 'conservative',
401-
Socialist: 'socialist',
402-
Nationalist: 'nationalist',
403-
Populist: 'populist',
404-
'Green / Eco-Socialist': 'green',
405-
Technocratic: 'technocratic',
406-
Libertarian: 'libertarian',
407-
'Effective Accelerationism': 'e/acc',
408-
'Pause AI / Tech Skeptic': 'pause ai',
409-
'Independent / Other': 'other',
410-
}}
396+
choices={POLITICAL_CHOICES}
411397
selected={profile['political_beliefs'] ?? []}
412398
onChange={(selected) => setProfile('political_beliefs', selected)}
413399
/>

web/components/profile-about.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import clsx from 'clsx'
22
import {convertRelationshipType, type RelationshipType,} from 'web/lib/util/convert-relationship-type'
33
import stringOrStringArrayToText from 'web/lib/util/string-or-string-array-to-text'
44
import {ReactNode} from 'react'
5-
import {REVERTED_ROMANTIC_CHOICES} from 'web/components/filters/choices'
5+
import {REVERTED_POLITICAL_CHOICES, REVERTED_ROMANTIC_CHOICES} from 'web/components/filters/choices'
66
import {BiSolidDrink} from 'react-icons/bi'
77
import {BsPersonHeart} from 'react-icons/bs'
88
import {FaChild} from 'react-icons/fa6'
@@ -60,7 +60,7 @@ export default function ProfileAbout(props: {
6060
<HasKids profile={profile}/>
6161
<AboutRow
6262
icon={<RiScales3Line className="h-5 w-5"/>}
63-
text={profile.political_beliefs}
63+
text={profile.political_beliefs?.map(belief => REVERTED_POLITICAL_CHOICES[belief])}
6464
/>
6565
<Education profile={profile}/>
6666
<Occupation profile={profile}/>

0 commit comments

Comments
 (0)