diff --git a/frontend/src/pages/index.tsx b/frontend/src/pages/index.tsx index fd04608..0a9c248 100644 --- a/frontend/src/pages/index.tsx +++ b/frontend/src/pages/index.tsx @@ -1,166 +1,87 @@ - import React, { useEffect, useState } from 'react'; import type { ReactElement } from 'react'; import Head from 'next/head'; import Link from 'next/link'; -import BaseButton from '../components/BaseButton'; -import CardBox from '../components/CardBox'; -import SectionFullScreen from '../components/SectionFullScreen'; +import axios from 'axios'; import LayoutGuest from '../layouts/Guest'; -import BaseDivider from '../components/BaseDivider'; -import BaseButtons from '../components/BaseButtons'; import { getPageTitle } from '../config'; -import { useAppSelector } from '../stores/hooks'; -import CardBoxComponentTitle from "../components/CardBoxComponentTitle"; -import { getPexelsImage, getPexelsVideo } from '../helpers/pexels'; +export default function PortfolioLanding() { + const [profile, setProfile] = useState(null); + const [projects, setProjects] = useState([]); + const [skills, setSkills] = useState([]); -export default function Starter() { - const [illustrationImage, setIllustrationImage] = useState({ - src: undefined, - photographer: undefined, - photographer_url: undefined, - }) - const [illustrationVideo, setIllustrationVideo] = useState({video_files: []}) - const [contentType, setContentType] = useState('image'); - const [contentPosition, setContentPosition] = useState('background'); - const textColor = useAppSelector((state) => state.style.linkColor); - - const title = 'App Preview' - - // Fetch Pexels image/video - useEffect(() => { - async function fetchData() { - const image = await getPexelsImage(); - const video = await getPexelsVideo(); - setIllustrationImage(image); - setIllustrationVideo(video); - } - fetchData(); - }, []); - - const imageBlock = (image) => ( -
-
- - Photo by {image?.photographer} on Pexels - -
-
- ); - - const videoBlock = (video) => { - if (video?.video_files?.length > 0) { - return ( -
- -
- - Video by {video.user.name} on Pexels - -
-
) - } - }; + useEffect(() => { + async function fetchData() { + try { + const [profileRes, projectsRes, skillsRes] = await Promise.all([ + axios.get('/personal_profiles'), + axios.get('/projects'), + axios.get('/skills'), + ]); + setProfile(profileRes.data.rows[0] || {}); + setProjects(projectsRes.data.rows || []); + setSkills(skillsRes.data.rows || []); + } catch (err) { + console.error('Error fetching data:', err); + } + } + fetchData(); + }, []); return ( -
+ <> - {getPageTitle('Starter Page')} + {getPageTitle('Portfolio')} - -
- {contentType === 'image' && contentPosition !== 'background' - ? imageBlock(illustrationImage) - : null} - {contentType === 'video' && contentPosition !== 'background' - ? videoBlock(illustrationVideo) - : null} -
- - - -
-

This is a React.js/Node.js app generated by the Flatlogic Web App Generator

-

For guides and documentation please check - your local README.md and the Flatlogic documentation

-
- - - +
+
+

PORTFOLIO

+ +
- - -
-
- -
-

© 2026 {title}. All rights reserved

- - Privacy Policy - -
+
+

+ {profile?.name || 'Full Stack Developer'} +

+

+ {profile?.bio || 'Building minimalist, modern, and elegant digital experiences.'} +

+
-
+
+

Projects

+
+ {projects.map((project: any) => ( +
+
+ {project.title} +
+

{project.title}

+

{project.description}

+
+ ))} +
+
+ +
+

Core Skills

+
+ {skills.map((skill: any) => ( + + {skill.name} + + ))} +
+
+
+ ); } -Starter.getLayout = function getLayout(page: ReactElement) { +PortfolioLanding.getLayout = function getLayout(page: ReactElement) { return {page}; }; -