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;
|
||||
status: string;
|
||||
statusColor: string;
|
||||
participants: {
|
||||
participants?: {
|
||||
current: number;
|
||||
target: number;
|
||||
};
|
||||
@@ -44,12 +44,14 @@ export const StudyCard: React.FC<StudyCardProps> = ({study}) => {
|
||||
{study.status}
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex justify-between mb-2">
|
||||
<span className="text-sm font-bold">Teilnehmer:</span>
|
||||
<span className="text-sm">
|
||||
{study.participants && (
|
||||
<div className="flex justify-between mb-2">
|
||||
<span className="text-sm font-bold">Teilnehmer:</span>
|
||||
<span className="text-sm">
|
||||
{study.participants.current.toLocaleString()} / {study.participants.target.toLocaleString()}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex justify-between">
|
||||
<span className="text-sm font-bold">Enddatum:</span>
|
||||
<span className="text-sm">{study.endDate}</span>
|
||||
|
@@ -1,236 +1,144 @@
|
||||
/**
|
||||
* Mock data for the ResearchLive page
|
||||
* Contains information about current studies, citizen science projects,
|
||||
* researcher interviews, and upcoming events
|
||||
*/
|
||||
// Updated MockResearchLive.ts
|
||||
|
||||
// Define color type to match component requirements
|
||||
type ColorType = 'purple' | 'blue' | 'violet' | 'emerald' | 'amber' | 'rose' | 'pink-red' | 'cta';
|
||||
|
||||
// Define study type
|
||||
interface Study {
|
||||
id: number;
|
||||
title: string;
|
||||
institution: string;
|
||||
status: string;
|
||||
statusColor: string;
|
||||
participants: {
|
||||
current: number;
|
||||
target: number;
|
||||
};
|
||||
participants?: { current: number; target: number };
|
||||
endDate: string;
|
||||
description: string;
|
||||
color: ColorType;
|
||||
}
|
||||
|
||||
// Define researcher interview type
|
||||
interface ResearcherInterview {
|
||||
interface CitizenScienceProject {
|
||||
id: number;
|
||||
name: string;
|
||||
institution: string;
|
||||
specialty: string;
|
||||
topics: string[];
|
||||
color: ColorType;
|
||||
videoId: string;
|
||||
title: string;
|
||||
icon: string;
|
||||
description: string;
|
||||
optedIn: boolean;
|
||||
}
|
||||
|
||||
interface Event {
|
||||
id: number;
|
||||
date: string;
|
||||
title: string;
|
||||
location: string;
|
||||
type: string;
|
||||
typeColor: string;
|
||||
}
|
||||
|
||||
// Current Studies data
|
||||
export const currentStudies: Study[] = [
|
||||
{
|
||||
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",
|
||||
institution: "University of Tokyo, Japan",
|
||||
status: "Aktiv",
|
||||
statusColor: "green",
|
||||
participants: {
|
||||
current: 3456,
|
||||
target: 10000
|
||||
},
|
||||
participants: {current: 3456, target: 10000},
|
||||
endDate: "31. Dezember 2025",
|
||||
description: "Diese globale Studie sammelt Traumsymbole aus verschiedenen Kulturen, um universelle und kulturspezifische Traumelemente zu identifizieren.",
|
||||
color: "amber"
|
||||
}
|
||||
description:
|
||||
"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 = [
|
||||
export const citizenScienceProjects: CitizenScienceProject[] = [
|
||||
{
|
||||
id: 1,
|
||||
title: "Globales Traumtagebuch",
|
||||
icon: "FaClipboardCheck",
|
||||
description: "Teile deine Träume in der weltweit größten Traumdatenbank und hilf Forschern, Muster zu erkennen.",
|
||||
optedIn: true
|
||||
description:
|
||||
"Teile deine Träume in der weltweit größten Traumdatenbank und hilf Forschern, Muster zu erkennen.",
|
||||
optedIn: true,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "Traumkarte",
|
||||
icon: "FaGlobeAmericas",
|
||||
description: "Hilf bei der Erstellung einer interaktiven Weltkarte, die zeigt, wie Träume je nach Region variieren.",
|
||||
optedIn: false
|
||||
icon: "FaGlobeEurope",
|
||||
description:
|
||||
"Hilf bei der Erstellung einer interaktiven Weltkarte, die zeigt, wie Träume je nach Region variieren.",
|
||||
optedIn: false,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "30-Tage-Challenge",
|
||||
icon: "FaCalendarAlt",
|
||||
description: "Nimm an der 30-Tage-Traumaufzeichnungs-Challenge teil und erhalte personalisierte Analysen.",
|
||||
optedIn: false
|
||||
title: "Kulturelle Traumlandschaften",
|
||||
icon: "FaUsers",
|
||||
description:
|
||||
"Teile deine demographischen Daten und hilf bei der Untersuchung der Auswirkung von Kultur aufs Träumen.",
|
||||
optedIn: false,
|
||||
}
|
||||
];
|
||||
|
||||
// Researcher Interviews data
|
||||
export const researcherInterviews: ResearcherInterview[] = [
|
||||
export const upcomingEvents: Event[] = [
|
||||
{
|
||||
id: 1,
|
||||
name: "Dr. Sarah Merton",
|
||||
institution: "Harvard University, USA",
|
||||
specialty: "Expertin für Traumkognition und neuronale Korrelate des Träumens",
|
||||
topics: [
|
||||
"Neueste Erkenntnisse zur Traumkognition",
|
||||
"Wie das Gehirn Traumnarrative konstruiert",
|
||||
"Die Rolle von REM-Schlaf bei der Gedächtniskonsolidierung"
|
||||
],
|
||||
color: "blue",
|
||||
videoId: "sarah_merton_interview"
|
||||
date: "16. August 2025",
|
||||
title: "Regional Dream Conference",
|
||||
location: "Ort wird noch bekanntgegeben",
|
||||
type: "Konferenz",
|
||||
typeColor: "blue",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Prof. Dr. Markus Weber",
|
||||
institution: "Max-Planck-Institut, Deutschland",
|
||||
specialty: "Pionier in der Erforschung luzider Träume und Traumkontrolle",
|
||||
topics: [
|
||||
"Techniken zur Induktion luzider Träume",
|
||||
"Therapeutische Anwendungen von Traumkontrolle",
|
||||
"Ethische Fragen in der Traummanipulation"
|
||||
],
|
||||
color: "emerald",
|
||||
videoId: "markus_weber_interview"
|
||||
date: "26. September 2025 – 27. September 2025",
|
||||
title: "Regional Dream Conference",
|
||||
location: "Bridgewater State University, USA",
|
||||
type: "Konferenz",
|
||||
typeColor: "emerald",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Dr. Yuki Tanaka",
|
||||
institution: "Kyoto University, Japan",
|
||||
specialty: "Spezialistin für kulturelle Traumforschung und vergleichende Traumanalyse",
|
||||
topics: [
|
||||
"Kulturelle Unterschiede in Traumsymbolen",
|
||||
"Einfluss von Mythen und Folklore auf Träume",
|
||||
"Universelle vs. kulturspezifische Traumelemente"
|
||||
],
|
||||
color: "amber",
|
||||
videoId: "yuki_tanaka_interview"
|
||||
date: "10. Oktober 2025 – 12. Oktober 2025",
|
||||
title: "Internationale Jahreskonferenz der IASD",
|
||||
location: "Ort wird noch bekanntgegeben",
|
||||
type: "Konferenz",
|
||||
typeColor: "rose",
|
||||
},
|
||||
{
|
||||
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 {
|
||||
currentStudies,
|
||||
citizenScienceProjects,
|
||||
researcherInterviews,
|
||||
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 HeroSection from '../../components/dreamarchive/HeroSection';
|
||||
import SectionHeader from '../../components/dreamarchive/SectionHeader';
|
||||
import DreamyCard from '../../components/dreamarchive/DreamyCard';
|
||||
import StudyCard from '../../components/dreamarchive/StudyCard';
|
||||
import ResearcherInterviewCard from '../../components/dreamarchive/ResearcherInterviewCard';
|
||||
import IconWithBackground from '../../components/dreamarchive/IconWithBackground';
|
||||
|
||||
export default function ResearchLive() {
|
||||
@@ -36,11 +35,11 @@ export default function ResearchLive() {
|
||||
case 'FaClipboardCheck':
|
||||
IconComponent = FaClipboardCheck;
|
||||
break;
|
||||
case 'FaGlobeAmericas':
|
||||
IconComponent = FaGlobeAmericas;
|
||||
case 'FaGlobeEurope':
|
||||
IconComponent = FaGlobeEurope;
|
||||
break;
|
||||
case 'FaCalendarAlt':
|
||||
IconComponent = FaCalendarAlt;
|
||||
case 'FaUsers':
|
||||
IconComponent = FaUsers;
|
||||
break;
|
||||
default:
|
||||
IconComponent = FaClipboardCheck;
|
||||
@@ -59,11 +58,11 @@ export default function ResearchLive() {
|
||||
<div className="mt-3 text-center">
|
||||
{project.optedIn ? (
|
||||
<button
|
||||
className="py-1 px-3 bg-violet-500 hover:bg-violet-600 text-white text-xs rounded-lg transition-colors">
|
||||
Du machst bereits mit!
|
||||
className="py-1 px-3 text-white text-xs rounded-lg transition-colors">
|
||||
Danke!
|
||||
</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
|
||||
</button>
|
||||
)}
|
||||
@@ -94,21 +93,6 @@ export default function ResearchLive() {
|
||||
</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 */}
|
||||
<div className="mb-12">
|
||||
<SectionHeader title="Kommende Veranstaltungen"/>
|
||||
|
@@ -26,6 +26,7 @@ export default class Dream{
|
||||
userId: number;
|
||||
title: string;
|
||||
date: Date;
|
||||
tags: string[];
|
||||
input: TextInput | ImageInput | AudioInput | ChipInput;
|
||||
ai?:{
|
||||
interpretation: string;
|
||||
@@ -34,12 +35,16 @@ export default class Dream{
|
||||
video?: string;
|
||||
models?: string;
|
||||
}
|
||||
vr?: {
|
||||
models: never;
|
||||
}
|
||||
|
||||
constructor(params: {
|
||||
id: number;
|
||||
userId: number;
|
||||
title: string;
|
||||
date: Date;
|
||||
tags: string[];
|
||||
input: TextInput | ImageInput | AudioInput;
|
||||
ai: {
|
||||
interpretation: string;
|
||||
@@ -53,6 +58,7 @@ export default class Dream{
|
||||
this.userId = params.userId;
|
||||
this.title = params.title;
|
||||
this.date = params.date;
|
||||
this.tags = params.tags;
|
||||
this.input = params.input;
|
||||
this.ai= params.ai;
|
||||
}
|
||||
|
Reference in New Issue
Block a user