From 8498480b9ccffbf1f2a418370d9e25dd6f5f8695 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Mon, 8 Sep 2025 22:35:57 +0200 Subject: [PATCH] Clean forms and prevent from changing username after creation --- web/components/optional-lover-form.tsx | 176 +++++++++++++------------ web/components/required-lover-form.tsx | 62 +++++---- web/pages/profile.tsx | 84 ++++++------ 3 files changed, 168 insertions(+), 154 deletions(-) diff --git a/web/components/optional-lover-form.tsx b/web/components/optional-lover-form.tsx index 5dc92ae2..07892318 100644 --- a/web/components/optional-lover-form.tsx +++ b/web/components/optional-lover-form.tsx @@ -26,6 +26,8 @@ import {SocialIcon} from './user/social' import {Select} from 'web/components/widgets/select' import {City, CityRow, loverToCity, useCitySearch} from "web/components/search-location"; import {AddPhotosWidget} from './widgets/add-photos' +import {RadioToggleGroup} from "web/components/widgets/radio-toggle-group"; +import {MultipleChoiceOptions} from "common/love/multiple-choice"; export const OptionalLoveUserForm = (props: { lover: LoverRow @@ -38,6 +40,7 @@ export const OptionalLoveUserForm = (props: { const {lover, user, buttonLabel, setLover, fromSignup, onSubmit} = props const [isSubmitting, setIsSubmitting] = useState(false) + const [lookingRelationship, setlookingRelationship] = useState(false) const router = useRouter() const [heightFeet, setHeightFeet] = useState( lover.height_in_inches @@ -138,34 +141,23 @@ export const OptionalLoveUserForm = (props: { return ( <> - - - + {/**/} + {/* */} + {/* {buttonLabel ?? 'Next / Skip'}*/} + {/* */} + {/**/} + More about me
Optional information
- {/**/} - {/* */} - {/* setLover('looking_for_matches', c)}*/} - {/* />*/} - {/**/} - - + {lover.city ? ( - + - {/**/} - {/* */} - {/* */} - {/* setLover('pref_relation_styles', selected)*/} - {/* }*/} - {/* />*/} - {/**/} - - + Min @@ -286,36 +262,6 @@ export const OptionalLoveUserForm = (props: { - {/**/} - {/* */} - {/* {*/} - {/* setLover('wants_kids_strength', choice)*/} - {/* }}*/} - {/* currentChoice={lover.wants_kids_strength ?? -1}*/} - {/* />*/} - {/**/} - - - - - {/*
*/} - {/* A real or stylized photo of you is required.*/} - {/*
*/} - - setLover('photo_urls', urls)} - setPinnedUrl={(url) => setLover('pinned_url', url)} - /> - - @@ -408,21 +354,6 @@ export const OptionalLoveUserForm = (props: { /> - - - { - const value = - e.target.value === '' ? null : Number(e.target.value) - setLover('has_kids', value) - }} - className={'w-20'} - min={0} - value={lover['has_kids'] ?? undefined} - /> - - + + + + { + const value = + e.target.value === '' ? null : Number(e.target.value) + setLover('has_kids', value) + }} + className={'w-20'} + min={0} + value={lover['has_kids'] ?? undefined} + /> + + + + + setlookingRelationship(c)} + /> + + + {lookingRelationship && <> + + + { + setLover('wants_kids_strength', choice) + }} + currentChoice={lover.wants_kids_strength ?? -1} + /> + + + + + + setLover('pref_relation_styles', selected) + } + /> + + } + + + + + {/*
*/} + {/* A real or stylized photo of you is required.*/} + {/*
*/} + + setLover('photo_urls', urls)} + setPinnedUrl={(url) => setLover('pinned_url', url)} + /> + + +