Fix connection type (2)

This commit is contained in:
MartinBraquet
2025-09-11 16:51:13 +02:00
parent 3283843ef3
commit f1bfc6bf55
5 changed files with 21 additions and 16 deletions

View File

@@ -51,10 +51,9 @@ export const baseLoversSchema = z.object({
pref_age_max: z.number().min(18).max(1000),
pref_relation_styles: z.array(
z.union([
z.literal('mono'),
z.literal('poly'),
z.literal('open'),
z.literal('other'),
z.literal('collaboration'),
z.literal('friendship'),
z.literal('relationship'),
])
),
wants_kids_strength: z.number(),

View File

@@ -1,11 +1,13 @@
export const RELATIONSHIP_CHOICES = {
Monogamous: 'mono',
Polyamorous: 'poly',
'Open Relationship': 'open',
Other: 'other',
// Monogamous: 'mono',
// Polyamorous: 'poly',
// 'Open Relationship': 'open',
// Other: 'other',
Collaboration: 'collaboration',
Friendship: 'friendship',
Relationship: 'relationship',
};
export const REVERTED_RELATIONSHIP_CHOICES = {}
export const REVERTED_RELATIONSHIP_CHOICES = Object.fromEntries(
Object.entries(RELATIONSHIP_CHOICES).map(([key, value]) => [value, key])
);

View File

@@ -131,13 +131,13 @@ function RelationshipType(props: { lover: Lover }) {
const relationshipTypes = lover.pref_relation_styles
const seekingGenderText = stringOrStringArrayToText({
text: relationshipTypes.map((rel) =>
convertRelationshipType(rel as RelationshipType)
),
convertRelationshipType(rel as RelationshipType).toLowerCase()
).sort(),
preText: 'Seeking',
postText:
relationshipTypes.length == 1 && relationshipTypes[0] == 'mono'
? 'relationship'
: 'relationships',
// postText:
// relationshipTypes.length == 1 && relationshipTypes[0] == 'mono'
// ? 'relationship'
// : 'relationships',
asSentence: true,
capitalizeFirstLetterOption: false,
})

View File

@@ -29,6 +29,7 @@ import {AddPhotosWidget} from './widgets/add-photos'
import {RadioToggleGroup} from "web/components/widgets/radio-toggle-group";
import {MultipleChoiceOptions} from "common/love/multiple-choice";
import {RELATIONSHIP_CHOICES} from "web/components/filters/choices";
import toast from "react-hot-toast";
export const OptionalLoveUserForm = (props: {
lover: LoverRow
@@ -69,6 +70,10 @@ export const OptionalLoveUserForm = (props: {
)
if (error) {
console.error(error)
toast.error(
`We ran into an issue saving your profile. Please try again or contact us if the issue persists.`
)
setIsSubmitting(false)
return
}
if (!isEqual(newLinks, user.link)) {

View File

@@ -14,7 +14,6 @@ import {
TbBrandSpotify,
TbBrandX,
} from 'react-icons/tb'
import Foldy from 'web/public/manifold-logo.svg'
export const PLATFORM_ICONS: {
[key in Site]: (props: { className?: string }) => ReactNode