mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-13 17:46:52 -04:00
Add books feature
This commit is contained in:
@@ -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"><
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user