dynamically display a page based on navigation
Unanswered
Savannah posted this in #help-forum
SavannahOP
Hello, I'm struggling with a subject that I think is quite simple... I don't understand how I can display different pages depending on my navigation. To be precise, in the yellow block, I'd like to display either the "Home" or "Projects" page... but I don't understand how to do this at all.
3 Replies
SavannahOP
My code :
export default function Dashboard() {
const brandName: string = "TeamTrack";
const user: User = {
id: 1,
username: "John Doe",
email: "test.1@gmail.com",
speciality: "Développeur Front-End",
avatar: [
{
seed: "Tigger",
backgroundColor: "#9B5DE5",
eyes: "shade01",
mouth: "diagram",
},
],
projects: [
{
id: 1,
name: "Interface UI/UX - Banque de France",
description: "Description du projet 1",
color: "#9B5DE5",
team: ["John Doe", "Jane Doe"],
},
{
id: 2,
name: "Application mobile - Banque de France",
description: "Description du projet 2",
color: "#F77F00",
team: ["John Doe", "Jane Doe"],
},
],
};
return (
<main>
<div className="brand_name">
<h1>{brandName}</h1>
</div>
<div className="avatar_search">
<SearchBar/>
<Notifications/>
<Avatar avatar={user.avatar}/>
</div>
<div className="main_content">
</div>
<NavBar/>
</main>
)
}I read the doc on the routes, nested routes, but I didn't understand anything