Add political_details

This commit is contained in:
MartinBraquet
2025-10-25 15:32:16 +02:00
parent 08a2438e79
commit f86a6a10ac
6 changed files with 16 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ export const sinclairProfile: ProfileRow = {
political_beliefs: ['e/acc', 'libertarian'],
religious_belief_strength: null,
religious_beliefs: null,
political_details: '',
photo_urls: [
'https://firebasestorage.googleapis.com/v0/b/mantic-markets.appspot.com/o/user-images%2FSinclair%2Flove-images%2FnJz22lr3Bl.jpg?alt=media&token=f1e99ba3-39cc-4637-8702-16a3a8dd49db',
'https://firebasestorage.googleapis.com/v0/b/mantic-markets.appspot.com/o/user-images%2FSinclair%2Flove-images%2FygM0mGgP_j.HEIC?alt=media&token=573b23d9-693c-4d6e-919b-097309f370e1',
@@ -153,6 +154,7 @@ export const jamesProfile: ProfileRow = {
political_beliefs: ['libertarian'],
religious_belief_strength: null,
religious_beliefs: '',
political_details: '',
photo_urls: [
'https://firebasestorage.googleapis.com/v0/b/mantic-markets.appspot.com/o/user-images%2FJamesGrugett%2Flove-images%2FKl0WtbZsZW.jpg?alt=media&token=c928604f-e5ff-4406-a229-152864a4aa48',
'https://firebasestorage.googleapis.com/v0/b/mantic-markets.appspot.com/o/user-images%2FJamesGrugett%2Flove-images%2Fsii17zOItz.jpg?alt=media&token=474034b9-0d23-4005-97ad-5864abfd85fe',

View File

@@ -35,6 +35,7 @@ CREATE TABLE IF NOT EXISTS profiles (
occupation_title TEXT,
photo_urls TEXT[],
pinned_url TEXT,
political_details TEXT,
political_beliefs TEXT[],
pref_age_max INTEGER NULL,
pref_age_min INTEGER NULL,

View File

@@ -77,6 +77,7 @@ const optionalProfilesSchema = z.object({
political_beliefs: z.array(z.string()).optional(),
religious_belief_strength: z.number().optional(),
religious_beliefs: z.string().optional(),
political_details: z.string().optional(),
religion: z.array(z.string()).optional(),
ethnicity: z.array(z.string()).optional(),
born_in_location: z.string().optional(),

View File

@@ -558,6 +558,7 @@ export type Database = {
photo_urls: string[] | null
pinned_url: string | null
political_beliefs: string[] | null
political_details: string | null
pref_age_max: number | null
pref_age_min: number | null
pref_gender: string[]
@@ -607,6 +608,7 @@ export type Database = {
photo_urls?: string[] | null
pinned_url?: string | null
political_beliefs?: string[] | null
political_details?: string | null
pref_age_max?: number | null
pref_age_min?: number | null
pref_gender: string[]
@@ -656,6 +658,7 @@ export type Database = {
photo_urls?: string[] | null
pinned_url?: string | null
political_beliefs?: string[] | null
political_details?: string | null
pref_age_max?: number | null
pref_age_min?: number | null
pref_gender?: string[]

View File

@@ -403,6 +403,13 @@ export const OptionalProfileUserForm = (props: {
selected={profile['political_beliefs'] ?? []}
onChange={(selected) => setProfile('political_beliefs', selected)}
/>
<p>Details:</p>
<Input
type="text"
onChange={(e) => setProfile('political_details', e.target.value)}
className={'w-full sm:w-96'}
value={profile['political_details'] ?? undefined}
/>
</Col>
<Col className={clsx(colClassName)}>
@@ -412,6 +419,7 @@ export const OptionalProfileUserForm = (props: {
selected={profile['religion'] ?? []}
onChange={(selected) => setProfile('religion', selected)}
/>
<p>Details:</p>
<Input
type="text"
onChange={(e) => setProfile('religious_beliefs', e.target.value)}

View File

@@ -79,6 +79,7 @@ export default function ProfileAbout(props: {
<AboutRow
icon={<RiScales3Line className="h-5 w-5"/>}
text={profile.political_beliefs?.map(belief => REVERTED_POLITICAL_CHOICES[belief])}
suffix={profile.political_details}
/>
<AboutRow
icon={<PiHandsPrayingBold className="h-5 w-5"/>}