Introduce team section with lawyers data; create reusable LawyerCard, LawyerProfile, LawyerModal, and Divider components; refactor Über Uns page layout and content.
This commit is contained in:
3
lawfirm-demos/demo-1/components/Divider.tsx
Normal file
3
lawfirm-demos/demo-1/components/Divider.tsx
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function Divider() {
|
||||
return <div className="w-full h-px bg-gray-200 my-16"/>;
|
||||
}
|
||||
18
lawfirm-demos/demo-1/components/LawyerCard.tsx
Normal file
18
lawfirm-demos/demo-1/components/LawyerCard.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
'use client';
|
||||
|
||||
export default function LawyerCard({ lawyer, onClick }: { lawyer: any; onClick: () => void }) {
|
||||
return (
|
||||
<button
|
||||
onClick={onClick}
|
||||
className="bg-neutral-100 hover:bg-neutral-200 transition p-6 rounded-xl shadow-sm text-left text-gray-800"
|
||||
>
|
||||
<img
|
||||
src={lawyer.image}
|
||||
alt={lawyer.name}
|
||||
className="w-full h-48 object-cover rounded-md mb-4"
|
||||
/>
|
||||
<h3 className="text-xl font-bold text-red-700 mb-2">{lawyer.name}</h3>
|
||||
<p className="text-sm text-gray-700">{lawyer.short}</p>
|
||||
</button>
|
||||
);
|
||||
}
|
||||
97
lawfirm-demos/demo-1/components/LawyerModal.tsx
Normal file
97
lawfirm-demos/demo-1/components/LawyerModal.tsx
Normal file
@@ -0,0 +1,97 @@
|
||||
'use client';
|
||||
|
||||
import {motion, AnimatePresence} from 'framer-motion';
|
||||
import {useEffect} from 'react';
|
||||
|
||||
export default function LawyerModal({
|
||||
lawyer,
|
||||
onClose,
|
||||
}: Readonly<{
|
||||
lawyer: any;
|
||||
onClose: () => void;
|
||||
}>) {
|
||||
// Close with Escape
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
if (e.key === 'Escape') onClose();
|
||||
};
|
||||
document.addEventListener('keydown', handleKeyDown);
|
||||
return () => document.removeEventListener('keydown', handleKeyDown);
|
||||
}, [onClose]);
|
||||
|
||||
return (
|
||||
<AnimatePresence>
|
||||
<motion.div
|
||||
initial={{opacity: 0}}
|
||||
animate={{opacity: 1}}
|
||||
exit={{opacity: 0}}
|
||||
className="fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex justify-center items-center p-4 overflow-y-auto"
|
||||
onClick={onClose}
|
||||
>
|
||||
<motion.div
|
||||
initial={{y: 40, opacity: 0}}
|
||||
animate={{y: 0, opacity: 1}}
|
||||
exit={{y: 30, opacity: 0}}
|
||||
transition={{duration: 0.3, ease: 'easeOut'}}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
className="bg-white rounded-xl max-w-3xl w-full p-8 relative text-gray-800 shadow-xl"
|
||||
>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="absolute top-4 right-4 text-gray-500 hover:text-gray-700 text-2xl font-bold"
|
||||
>
|
||||
×
|
||||
</button>
|
||||
|
||||
<div className="flex flex-col md:flex-row gap-6">
|
||||
{lawyer.image && (
|
||||
<img
|
||||
src={lawyer.image}
|
||||
alt={lawyer.name}
|
||||
className="w-full md:w-1/3 h-auto object-cover rounded-md"
|
||||
/>
|
||||
)}
|
||||
|
||||
<div className="flex-1 space-y-4">
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-red-700">{lawyer.name}</h2>
|
||||
<p className="text-sm text-gray-500">{lawyer.short}</p>
|
||||
</div>
|
||||
|
||||
{lawyer.specialties?.length > 0 && (
|
||||
<div>
|
||||
<h3 className="font-semibold text-gray-800">Fachgebiete</h3>
|
||||
<ul className="list-disc pl-5 text-sm text-gray-700">
|
||||
{lawyer.specialties.map((s: string, i: number) => (
|
||||
<li key={i}>{s}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{lawyer.biography && (
|
||||
<div>
|
||||
<h3 className="font-semibold text-gray-800">Über</h3>
|
||||
<p className="text-sm leading-relaxed text-gray-700 whitespace-pre-line">
|
||||
{lawyer.biography}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{lawyer.personal?.length > 0 && (
|
||||
<div>
|
||||
<h3 className="font-semibold text-gray-800">Zur Person</h3>
|
||||
<ul className="list-disc pl-5 text-sm text-gray-700">
|
||||
{lawyer.personal.map((p: string, i: number) => (
|
||||
<li key={i}>{p}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</motion.div>
|
||||
</motion.div>
|
||||
</AnimatePresence>
|
||||
);
|
||||
}
|
||||
53
lawfirm-demos/demo-1/components/LawyerProfile.tsx
Normal file
53
lawfirm-demos/demo-1/components/LawyerProfile.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
'use client';
|
||||
|
||||
export default function LawyerProfile({lawyer, reverse = false}: Readonly<{ lawyer: any; reverse?: boolean }>) {
|
||||
return (
|
||||
<section className={`flex flex-col md:flex-row ${reverse ? 'md:flex-row-reverse' : ''} gap-10 md:items-start`}>
|
||||
{/* image */}
|
||||
<div className="w-full md:w-1/3">
|
||||
<img
|
||||
src={lawyer.image}
|
||||
alt={lawyer.name}
|
||||
className="w-full h-auto rounded-xl shadow-sm object-cover"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* content */}
|
||||
<div className="w-full md:w-2/3 space-y-6 text-[17px] text-gray-800 leading-relaxed">
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold text-red-700">{lawyer.name}</h2>
|
||||
<p>{lawyer.short}</p>
|
||||
</div>
|
||||
|
||||
{lawyer.biography && (
|
||||
<div>
|
||||
<h3 className="font-semibold mb-1">Zur Person</h3>
|
||||
<p className="whitespace-pre-line">{lawyer.biography}</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{lawyer.specialties?.length > 0 && (
|
||||
<div>
|
||||
<h3 className="font-semibold mb-1">Fachgebiete</h3>
|
||||
<ul className="list-disc pl-5 space-y-1">
|
||||
{lawyer.specialties.map((s: string, i: number) => (
|
||||
<li key={i}>{s}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{lawyer.personal?.length > 0 && (
|
||||
<div>
|
||||
<h3 className="font-semibold mb-1">Ausbildung & Mitgliedschaften</h3>
|
||||
<ul className="list-disc pl-5 space-y-1">
|
||||
{lawyer.personal.map((p: string, i: number) => (
|
||||
<li key={i}>{p}</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user