Add books feature

This commit is contained in:
MartinBraquet
2025-08-11 17:38:26 +02:00
parent 131cb0ff79
commit 078893f7d1
11 changed files with 150 additions and 27 deletions

View File

@@ -115,19 +115,21 @@ export function Profile(url: string, header: any = null) {
interface Tags {
profileAttribute: string;
attribute: string;
attribute?: string;
title: string;
}
const tagsConfig: Tags[] = [
{profileAttribute: 'desiredConnections', attribute: 'connection', title: 'Connection Type'},
{profileAttribute: 'coreValues', attribute: 'value', title: 'Values'},
{profileAttribute: 'coreValues', title: 'Values'},
{profileAttribute: 'intellectualInterests', attribute: 'interest', title: 'Interests'},
{profileAttribute: 'books', title: 'Works to Discuss'},
// {profileAttribute: 'causeAreas', attribute: 'causeArea', title: 'Cause Areas'},
]
function getTags({profileAttribute, attribute, title}: Tags) {
function getTags({profileAttribute, attribute = 'value', title}: Tags) {
const values = userData?.profile?.[profileAttribute];
console.log('values', values);
return <div key={profileAttribute + '.div'}>
{values?.length > 0 && (
<div className="mt-3"><

View File

@@ -16,6 +16,7 @@ export interface ProfileData {
contactInfo: string;
intellectualInterests: { interest?: { name?: string, id?: string } }[];
coreValues: { value?: { name?: string, id?: string } }[];
books: { value?: { name?: string, id?: string } }[];
causeAreas: { causeArea?: { name?: string, id?: string } }[];
desiredConnections: { connection?: { name?: string, id?: string } }[];
promptAnswers: { prompt?: string; answer?: string, id?: string }[];
@@ -23,7 +24,7 @@ export interface ProfileData {
};
}
export type DropdownKey = 'interests' | 'causeAreas' | 'connections' | 'coreValues';
export type DropdownKey = 'interests' | 'causeAreas' | 'connections' | 'coreValues' | 'books';
export type RangeKey = 'age' | 'introversion';
// type OtherKey = 'gender' | 'searchQuery';

View File

@@ -29,6 +29,7 @@ export async function retrieveUser(id: string) {
intellectualInterests: {include: {interest: true}},
causeAreas: {include: {causeArea: true}},
coreValues: {include: {value: true}},
books: {include: {value: true}},
desiredConnections: {include: {connection: true}},
promptAnswers: true,
},