mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-13 19:17:15 -04:00
Fix connection type (2)
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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])
|
||||
);
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user