react-typescript-test/app/page.tsx

42 lines
1.3 KiB
TypeScript

"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
function MyApp() {
// State to track the current view
const [currentView, setCurrentView] = useState('landing');
// Function to handle navigation
const handleNavigation = (view: string) => {
setCurrentView(view);
};
return (
<div>
{/* 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 />}
{currentView === 'luca' && <Luca />}
{currentView === 'patrick' && <Patrick />}
{currentView === 'yasin' && <Yasin />}
</div>
</div>
);
}
export default MyApp;