refactor: add TypeScript types to scrollToSection and ProjectGallery components

This commit is contained in:
2025-06-26 17:05:33 +02:00
parent 45db885cf3
commit 9e4a6a8c95
+7 -2
View File
@@ -118,12 +118,17 @@ const Portfolio = () => {
'Python for Data Science, AI & Development' 'Python for Data Science, AI & Development'
]; ];
const scrollToSection = (sectionId) => { const scrollToSection = (sectionId: string) => {
document.getElementById(sectionId)?.scrollIntoView({ behavior: 'smooth' }); document.getElementById(sectionId)?.scrollIntoView({ behavior: 'smooth' });
setActiveSection(sectionId); setActiveSection(sectionId);
}; };
const ProjectGallery = ({ project, onClose }) => ( type Project = typeof projects[number];
interface ProjectGalleryProps {
project: Project;
onClose: () => void;
}
const ProjectGallery: React.FC<ProjectGalleryProps> = ({ project, onClose }) => (
<div <div
className="fixed inset-0 z-50 flex items-center justify-center p-4" className="fixed inset-0 z-50 flex items-center justify-center p-4"
style={{ backgroundColor: 'rgba(46, 52, 64, 0.95)' }} style={{ backgroundColor: 'rgba(46, 52, 64, 0.95)' }}