react-typescript-test/app/page.tsx

43 lines
1.3 KiB
TypeScript
Raw Permalink Normal View History

2024-09-04 15:58:03 +02:00
"use client";
import React, { useState } from 'react';
import Luca from './luca/Luca';
import Patrick from './patrick/Patrick';
import Yasin from './yasin/Yasin';
import Home from './LandingPage';
import './App.css'; // Import main styles
2024-09-04 15:58:03 +02:00
function MyApp() {
// State to track the current view
const [currentView, setCurrentView] = useState('landing');
// Function to handle navigation
const handleNavigation = (view: string) => {
setCurrentView(view);
};
2024-09-03 19:08:37 +02:00
return (
<div>
2024-09-04 15:58:03 +02:00
{/* Header with navigation buttons */}
<header className="header">
<h1>Welcome to the Programmer Space</h1>
<nav>
<button onClick={() => handleNavigation('landing')}>Home</button>
<button onClick={() => handleNavigation('luca')}>Luca</button>
<button onClick={() => handleNavigation('patrick')}>Patrick</button>
<button onClick={() => handleNavigation('yasin')}>Yasin</button>
</nav>
</header>
<div className="content">
{/* Conditionally render the selected component */}
{currentView === 'landing' && <Home />}
2024-09-04 15:58:03 +02:00
{currentView === 'luca' && <Luca />}
{currentView === 'patrick' && <Patrick />}
{currentView === 'yasin' && <Yasin />}
</div>
</div>
);
2024-09-03 19:08:37 +02:00
}
2024-09-04 15:58:03 +02:00
export default MyApp;