refactored ResearchLive
data structure and components: updated mock data models, removed researcher interviews section, and revised StudyCard
handling for optional participants field
Signed-off-by: Matthias Puchstein <matthias@puchstein.bayern>
This commit is contained in:
@@ -10,7 +10,7 @@ interface StudyCardProps {
|
|||||||
institution: string;
|
institution: string;
|
||||||
status: string;
|
status: string;
|
||||||
statusColor: string;
|
statusColor: string;
|
||||||
participants: {
|
participants?: {
|
||||||
current: number;
|
current: number;
|
||||||
target: number;
|
target: number;
|
||||||
};
|
};
|
||||||
@@ -44,12 +44,14 @@ export const StudyCard: React.FC<StudyCardProps> = ({study}) => {
|
|||||||
{study.status}
|
{study.status}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between mb-2">
|
{study.participants && (
|
||||||
<span className="text-sm font-bold">Teilnehmer:</span>
|
<div className="flex justify-between mb-2">
|
||||||
<span className="text-sm">
|
<span className="text-sm font-bold">Teilnehmer:</span>
|
||||||
|
<span className="text-sm">
|
||||||
{study.participants.current.toLocaleString()} / {study.participants.target.toLocaleString()}
|
{study.participants.current.toLocaleString()} / {study.participants.target.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<span className="text-sm font-bold">Enddatum:</span>
|
<span className="text-sm font-bold">Enddatum:</span>
|
||||||
<span className="text-sm">{study.endDate}</span>
|
<span className="text-sm">{study.endDate}</span>
|
||||||
|
@@ -1,236 +1,144 @@
|
|||||||
/**
|
// Updated MockResearchLive.ts
|
||||||
* Mock data for the ResearchLive page
|
|
||||||
* Contains information about current studies, citizen science projects,
|
|
||||||
* researcher interviews, and upcoming events
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Define color type to match component requirements
|
|
||||||
type ColorType = 'purple' | 'blue' | 'violet' | 'emerald' | 'amber' | 'rose' | 'pink-red' | 'cta';
|
type ColorType = 'purple' | 'blue' | 'violet' | 'emerald' | 'amber' | 'rose' | 'pink-red' | 'cta';
|
||||||
|
|
||||||
// Define study type
|
|
||||||
interface Study {
|
interface Study {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
institution: string;
|
institution: string;
|
||||||
status: string;
|
status: string;
|
||||||
statusColor: string;
|
statusColor: string;
|
||||||
participants: {
|
participants?: { current: number; target: number };
|
||||||
current: number;
|
|
||||||
target: number;
|
|
||||||
};
|
|
||||||
endDate: string;
|
endDate: string;
|
||||||
description: string;
|
description: string;
|
||||||
color: ColorType;
|
color: ColorType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Define researcher interview type
|
interface CitizenScienceProject {
|
||||||
interface ResearcherInterview {
|
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
title: string;
|
||||||
institution: string;
|
icon: string;
|
||||||
specialty: string;
|
description: string;
|
||||||
topics: string[];
|
optedIn: boolean;
|
||||||
color: ColorType;
|
}
|
||||||
videoId: string;
|
|
||||||
|
interface Event {
|
||||||
|
id: number;
|
||||||
|
date: string;
|
||||||
|
title: string;
|
||||||
|
location: string;
|
||||||
|
type: string;
|
||||||
|
typeColor: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Current Studies data
|
|
||||||
export const currentStudies: Study[] = [
|
export const currentStudies: Study[] = [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
title: "Traumkontinuität während der Pandemie",
|
|
||||||
institution: "Universität Zürich, Schweiz",
|
|
||||||
status: "Aktiv",
|
|
||||||
statusColor: "green",
|
|
||||||
participants: {
|
|
||||||
current: 1245,
|
|
||||||
target: 2000
|
|
||||||
},
|
|
||||||
endDate: "31. Dezember 2024",
|
|
||||||
description: "Diese Langzeitstudie untersucht, wie sich Träume während und nach der COVID-19-Pandemie verändert haben und ob Traumthemen mit realen Ereignissen korrelieren.",
|
|
||||||
color: "purple"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
title: "Luzide Träume und Kreativität",
|
|
||||||
institution: "Stanford University, USA",
|
|
||||||
status: "Aktiv",
|
|
||||||
statusColor: "green",
|
|
||||||
participants: {
|
|
||||||
current: 876,
|
|
||||||
target: 1000
|
|
||||||
},
|
|
||||||
endDate: "15. März 2025",
|
|
||||||
description: "Diese Studie untersucht den Zusammenhang zwischen der Fähigkeit, luzide Träume zu erleben, und kreativen Problemlösungsfähigkeiten im Wachzustand.",
|
|
||||||
color: "blue"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
title: "Traumemotionen und mentale Gesundheit",
|
|
||||||
institution: "Universität Wien, Österreich",
|
|
||||||
status: "Fast voll",
|
|
||||||
statusColor: "yellow",
|
|
||||||
participants: {
|
|
||||||
current: 1890,
|
|
||||||
target: 2000
|
|
||||||
},
|
|
||||||
endDate: "30. September 2024",
|
|
||||||
description: "Diese Studie erforscht die Beziehung zwischen emotionalen Mustern in Träumen und verschiedenen Aspekten der psychischen Gesundheit im Wachzustand.",
|
|
||||||
color: "emerald"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
title: "Kulturübergreifende Traumsymbole",
|
title: "Kulturübergreifende Traumsymbole",
|
||||||
institution: "University of Tokyo, Japan",
|
institution: "University of Tokyo, Japan",
|
||||||
status: "Aktiv",
|
status: "Aktiv",
|
||||||
statusColor: "green",
|
statusColor: "green",
|
||||||
participants: {
|
participants: {current: 3456, target: 10000},
|
||||||
current: 3456,
|
|
||||||
target: 10000
|
|
||||||
},
|
|
||||||
endDate: "31. Dezember 2025",
|
endDate: "31. Dezember 2025",
|
||||||
description: "Diese globale Studie sammelt Traumsymbole aus verschiedenen Kulturen, um universelle und kulturspezifische Traumelemente zu identifizieren.",
|
description:
|
||||||
color: "amber"
|
"Diese globale Studie sammelt Traumsymbole aus verschiedenen Kulturen, um universelle und kulturspezifische Traumelemente zu identifizieren.",
|
||||||
}
|
color: "amber",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
title: "Time course of the lucid dream experience",
|
||||||
|
institution: "Organization for Lucid Dream Studies",
|
||||||
|
status: "Laufend",
|
||||||
|
statusColor: "green",
|
||||||
|
endDate: "April 2026",
|
||||||
|
description:
|
||||||
|
"Untersuchung, wann und wie Träume in luzide Träume übergehen und was danach geschieht.",
|
||||||
|
color: "violet",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
title: "Reality monitoring & state test reliability",
|
||||||
|
institution: "Organization for Lucid Dream Studies",
|
||||||
|
status: "Laufend",
|
||||||
|
statusColor: "green",
|
||||||
|
endDate: "August 2027",
|
||||||
|
description:
|
||||||
|
"Vergleich von Reality-Monitoring-Fehlern und Traum-Wach-Verwechslungen in Bezug auf die Häufigkeit luzider Träume.",
|
||||||
|
color: "pink-red",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
title: "Rapid Eye Movement Restoration and Enhancement for Sleep-deprived Trauma-adaptation",
|
||||||
|
institution: "University of Wisconsin–Madison, USA",
|
||||||
|
status: "Laufend",
|
||||||
|
statusColor: "green",
|
||||||
|
endDate: "31. August 2025",
|
||||||
|
description:
|
||||||
|
"Untersuchung, ob gezielte REM-Schlaf-Wiederherstellung und -Förderung bei schlafentzugbedingten Traumafolgestörungen die Symptome lindert und die Erholung verbessert.",
|
||||||
|
color: "emerald",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// Citizen Science projects data
|
export const citizenScienceProjects: CitizenScienceProject[] = [
|
||||||
export const citizenScienceProjects = [
|
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
title: "Globales Traumtagebuch",
|
title: "Globales Traumtagebuch",
|
||||||
icon: "FaClipboardCheck",
|
icon: "FaClipboardCheck",
|
||||||
description: "Teile deine Träume in der weltweit größten Traumdatenbank und hilf Forschern, Muster zu erkennen.",
|
description:
|
||||||
optedIn: true
|
"Teile deine Träume in der weltweit größten Traumdatenbank und hilf Forschern, Muster zu erkennen.",
|
||||||
|
optedIn: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
title: "Traumkarte",
|
title: "Traumkarte",
|
||||||
icon: "FaGlobeAmericas",
|
icon: "FaGlobeEurope",
|
||||||
description: "Hilf bei der Erstellung einer interaktiven Weltkarte, die zeigt, wie Träume je nach Region variieren.",
|
description:
|
||||||
optedIn: false
|
"Hilf bei der Erstellung einer interaktiven Weltkarte, die zeigt, wie Träume je nach Region variieren.",
|
||||||
|
optedIn: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
title: "30-Tage-Challenge",
|
title: "Kulturelle Traumlandschaften",
|
||||||
icon: "FaCalendarAlt",
|
icon: "FaUsers",
|
||||||
description: "Nimm an der 30-Tage-Traumaufzeichnungs-Challenge teil und erhalte personalisierte Analysen.",
|
description:
|
||||||
optedIn: false
|
"Teile deine demographischen Daten und hilf bei der Untersuchung der Auswirkung von Kultur aufs Träumen.",
|
||||||
|
optedIn: false,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
// Researcher Interviews data
|
export const upcomingEvents: Event[] = [
|
||||||
export const researcherInterviews: ResearcherInterview[] = [
|
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: "Dr. Sarah Merton",
|
date: "16. August 2025",
|
||||||
institution: "Harvard University, USA",
|
title: "Regional Dream Conference",
|
||||||
specialty: "Expertin für Traumkognition und neuronale Korrelate des Träumens",
|
location: "Ort wird noch bekanntgegeben",
|
||||||
topics: [
|
type: "Konferenz",
|
||||||
"Neueste Erkenntnisse zur Traumkognition",
|
typeColor: "blue",
|
||||||
"Wie das Gehirn Traumnarrative konstruiert",
|
|
||||||
"Die Rolle von REM-Schlaf bei der Gedächtniskonsolidierung"
|
|
||||||
],
|
|
||||||
color: "blue",
|
|
||||||
videoId: "sarah_merton_interview"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
name: "Prof. Dr. Markus Weber",
|
date: "26. September 2025 – 27. September 2025",
|
||||||
institution: "Max-Planck-Institut, Deutschland",
|
title: "Regional Dream Conference",
|
||||||
specialty: "Pionier in der Erforschung luzider Träume und Traumkontrolle",
|
location: "Bridgewater State University, USA",
|
||||||
topics: [
|
type: "Konferenz",
|
||||||
"Techniken zur Induktion luzider Träume",
|
typeColor: "emerald",
|
||||||
"Therapeutische Anwendungen von Traumkontrolle",
|
|
||||||
"Ethische Fragen in der Traummanipulation"
|
|
||||||
],
|
|
||||||
color: "emerald",
|
|
||||||
videoId: "markus_weber_interview"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
name: "Dr. Yuki Tanaka",
|
date: "10. Oktober 2025 – 12. Oktober 2025",
|
||||||
institution: "Kyoto University, Japan",
|
title: "Internationale Jahreskonferenz der IASD",
|
||||||
specialty: "Spezialistin für kulturelle Traumforschung und vergleichende Traumanalyse",
|
location: "Ort wird noch bekanntgegeben",
|
||||||
topics: [
|
type: "Konferenz",
|
||||||
"Kulturelle Unterschiede in Traumsymbolen",
|
typeColor: "rose",
|
||||||
"Einfluss von Mythen und Folklore auf Träume",
|
|
||||||
"Universelle vs. kulturspezifische Traumelemente"
|
|
||||||
],
|
|
||||||
color: "amber",
|
|
||||||
videoId: "yuki_tanaka_interview"
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
name: "Dr. Elena Rodriguez",
|
|
||||||
institution: "Universidad de Barcelona, Spanien",
|
|
||||||
specialty: "Forscherin im Bereich Traumtherapie und emotionale Verarbeitung",
|
|
||||||
topics: [
|
|
||||||
"Traumbasierte Therapieansätze",
|
|
||||||
"Verarbeitung traumatischer Erlebnisse im Traum",
|
|
||||||
"Emotionale Regulation durch gezielte Traumarbeit"
|
|
||||||
],
|
|
||||||
color: "rose",
|
|
||||||
videoId: "elena_rodriguez_interview"
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// Upcoming Events data
|
|
||||||
export const upcomingEvents = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
date: "15. Juli 2024",
|
|
||||||
title: "Internationale Konferenz für Traumforschung",
|
|
||||||
location: "Berlin, Deutschland",
|
|
||||||
type: "Konferenz",
|
|
||||||
typeColor: "blue"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
date: "3. August 2024",
|
|
||||||
title: "Workshop: Luzide Träume für Anfänger",
|
|
||||||
location: "Online",
|
|
||||||
type: "Workshop",
|
|
||||||
typeColor: "green"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
date: "22. September 2024",
|
|
||||||
title: "Symposium: Träume und psychische Gesundheit",
|
|
||||||
location: "Wien, Österreich",
|
|
||||||
type: "Symposium",
|
|
||||||
typeColor: "amber"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
date: "10. Oktober 2024",
|
|
||||||
title: "Webinar: Neueste Technologien in der Traumforschung",
|
|
||||||
location: "Online",
|
|
||||||
type: "Webinar",
|
|
||||||
typeColor: "purple"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
date: "5. November 2024",
|
|
||||||
title: "Traumforschung 2025: Ausblick und Trends",
|
|
||||||
location: "Paris, Frankreich",
|
|
||||||
type: "Konferenz",
|
|
||||||
typeColor: "rose"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
// Define the type for the exported object
|
|
||||||
interface MockResearchLiveData {
|
|
||||||
currentStudies: Study[];
|
|
||||||
citizenScienceProjects: any[]; // Using any for now as we haven't defined a specific type
|
|
||||||
researcherInterviews: ResearcherInterview[];
|
|
||||||
upcomingEvents: any[]; // Using any for now as we haven't defined a specific type
|
|
||||||
}
|
|
||||||
|
|
||||||
// Export with type information
|
|
||||||
export default {
|
export default {
|
||||||
currentStudies,
|
currentStudies,
|
||||||
citizenScienceProjects,
|
citizenScienceProjects,
|
||||||
researcherInterviews,
|
|
||||||
upcomingEvents
|
upcomingEvents
|
||||||
} as MockResearchLiveData;
|
} as {
|
||||||
|
currentStudies: Study[];
|
||||||
|
citizenScienceProjects: CitizenScienceProject[];
|
||||||
|
upcomingEvents: Event[];
|
||||||
|
};
|
||||||
|
@@ -1,10 +1,9 @@
|
|||||||
import {FaCalendarAlt, FaClipboardCheck, FaGlobeAmericas} from 'react-icons/fa';
|
import {FaCalendarAlt, FaClipboardCheck, FaGlobeEurope, FaUsers} from 'react-icons/fa';
|
||||||
import mockResearchLive from '../../data/MockResearchLive';
|
import mockResearchLive from '../../data/MockResearchLive';
|
||||||
import HeroSection from '../../components/dreamarchive/HeroSection';
|
import HeroSection from '../../components/dreamarchive/HeroSection';
|
||||||
import SectionHeader from '../../components/dreamarchive/SectionHeader';
|
import SectionHeader from '../../components/dreamarchive/SectionHeader';
|
||||||
import DreamyCard from '../../components/dreamarchive/DreamyCard';
|
import DreamyCard from '../../components/dreamarchive/DreamyCard';
|
||||||
import StudyCard from '../../components/dreamarchive/StudyCard';
|
import StudyCard from '../../components/dreamarchive/StudyCard';
|
||||||
import ResearcherInterviewCard from '../../components/dreamarchive/ResearcherInterviewCard';
|
|
||||||
import IconWithBackground from '../../components/dreamarchive/IconWithBackground';
|
import IconWithBackground from '../../components/dreamarchive/IconWithBackground';
|
||||||
|
|
||||||
export default function ResearchLive() {
|
export default function ResearchLive() {
|
||||||
@@ -36,11 +35,11 @@ export default function ResearchLive() {
|
|||||||
case 'FaClipboardCheck':
|
case 'FaClipboardCheck':
|
||||||
IconComponent = FaClipboardCheck;
|
IconComponent = FaClipboardCheck;
|
||||||
break;
|
break;
|
||||||
case 'FaGlobeAmericas':
|
case 'FaGlobeEurope':
|
||||||
IconComponent = FaGlobeAmericas;
|
IconComponent = FaGlobeEurope;
|
||||||
break;
|
break;
|
||||||
case 'FaCalendarAlt':
|
case 'FaUsers':
|
||||||
IconComponent = FaCalendarAlt;
|
IconComponent = FaUsers;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
IconComponent = FaClipboardCheck;
|
IconComponent = FaClipboardCheck;
|
||||||
@@ -59,11 +58,11 @@ export default function ResearchLive() {
|
|||||||
<div className="mt-3 text-center">
|
<div className="mt-3 text-center">
|
||||||
{project.optedIn ? (
|
{project.optedIn ? (
|
||||||
<button
|
<button
|
||||||
className="py-1 px-3 bg-violet-500 hover:bg-violet-600 text-white text-xs rounded-lg transition-colors">
|
className="py-1 px-3 text-white text-xs rounded-lg transition-colors">
|
||||||
Du machst bereits mit!
|
Danke!
|
||||||
</button>) : (
|
</button>) : (
|
||||||
<button
|
<button
|
||||||
className="py-1 px-3 bg-violet-500 hover:bg-violet-600 text-green text-xs rounded-lg transition-colors">
|
className="py-1 px-3 dreamy-button text-green text-xs rounded-lg transition-colors">
|
||||||
Beitragen
|
Beitragen
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
@@ -94,21 +93,6 @@ export default function ResearchLive() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Researcher Interviews
|
|
||||||
<div className="mb-12">
|
|
||||||
<SectionHeader title="Forscher-Interviews"/>
|
|
||||||
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
||||||
{mockResearchLive.researcherInterviews.slice(0, 2).map((interview) => (
|
|
||||||
<ResearcherInterviewCard key={interview.id} interview={interview}/>))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-6 mt-6">
|
|
||||||
{mockResearchLive.researcherInterviews.slice(2, 4).map((interview) => (
|
|
||||||
<ResearcherInterviewCard key={interview.id} interview={interview}/>))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Upcoming Events */}
|
{/* Upcoming Events */}
|
||||||
<div className="mb-12">
|
<div className="mb-12">
|
||||||
<SectionHeader title="Kommende Veranstaltungen"/>
|
<SectionHeader title="Kommende Veranstaltungen"/>
|
||||||
|
@@ -26,6 +26,7 @@ export default class Dream{
|
|||||||
userId: number;
|
userId: number;
|
||||||
title: string;
|
title: string;
|
||||||
date: Date;
|
date: Date;
|
||||||
|
tags: string[];
|
||||||
input: TextInput | ImageInput | AudioInput | ChipInput;
|
input: TextInput | ImageInput | AudioInput | ChipInput;
|
||||||
ai?:{
|
ai?:{
|
||||||
interpretation: string;
|
interpretation: string;
|
||||||
@@ -34,12 +35,16 @@ export default class Dream{
|
|||||||
video?: string;
|
video?: string;
|
||||||
models?: string;
|
models?: string;
|
||||||
}
|
}
|
||||||
|
vr?: {
|
||||||
|
models: never;
|
||||||
|
}
|
||||||
|
|
||||||
constructor(params: {
|
constructor(params: {
|
||||||
id: number;
|
id: number;
|
||||||
userId: number;
|
userId: number;
|
||||||
title: string;
|
title: string;
|
||||||
date: Date;
|
date: Date;
|
||||||
|
tags: string[];
|
||||||
input: TextInput | ImageInput | AudioInput;
|
input: TextInput | ImageInput | AudioInput;
|
||||||
ai: {
|
ai: {
|
||||||
interpretation: string;
|
interpretation: string;
|
||||||
@@ -53,6 +58,7 @@ export default class Dream{
|
|||||||
this.userId = params.userId;
|
this.userId = params.userId;
|
||||||
this.title = params.title;
|
this.title = params.title;
|
||||||
this.date = params.date;
|
this.date = params.date;
|
||||||
|
this.tags = params.tags;
|
||||||
this.input = params.input;
|
this.input = params.input;
|
||||||
this.ai= params.ai;
|
this.ai= params.ai;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user