Main content overlaps with sidebar navigation
Answered
Swedish Lapphund posted this in #help-forum
Swedish LapphundOP
So currently I have the following:
"use client"
import React from 'react';
import { Card, CardContent, CardMedia, Typography } from '@mui/material';
import Header from '../../components/common/header';
import SideNavigation from '../../components/common/side_navigation_bar';
import styles from '../../styles/panel/dashboard.module.css';
const Dashboard = () => {
const handleClick = (buttonName) => {
console.log(`Clicked on ${buttonName}`);
// Handle your button click event here
};
const cardsData = [
{
id: 1,
imageSrc: 'https://example.com/image1.jpg',
title: 'Onderzoek 1',
estimatedTime: '60 minuten',
timeLeft: '3 dagen',
description: 'Dit is een onderzoek',
},
{
id: 2,
imageSrc: 'https://example.com/image2.jpg',
title: 'Onderzoek 2',
estimatedTime: '60 minuten',
timeLeft: '3 dagen',
description: 'Dit is een ander onderzoek',
},
// Add more card data as needed
];
return (
<div className={styles.container}>
<SideNavigation handleClick={handleClick} />
<div className={styles.main}>
<Header />
<div className={styles.mainContent}>
{cardsData.map((card) => (
<Card key={card.id} className={styles.card}>
<CardMedia
component="img"
height="140"
image={card.imageSrc}
alt={card.title}
/>
<CardContent>
<Typography variant="h6">{card.title}</Typography>
<Typography>{`Estimated Time: ${card.estimatedTime}`}</Typography>
<Typography>{`Time Left: ${card.timeLeft}`}</Typography>
<Typography>{card.description}</Typography>
</CardContent>
</Card>
))}
</div>
</div>
</div>
);
};
export default Dashboard;4 Replies
Swedish LapphundOP
with the following style module:
/* panel_dashboard.module.css */
.container {
display: flex;
height: 100vh;
}
.sidebar {
width: 200px;
background-color: white;
display: flex;
flex-direction: column;
padding: 10px;
align-items: center;
}
.sidebarImage {
width: 80%;
height: auto;
margin-bottom: 16px;
}
.main {
display: flex;
flex-direction: column;
margin-left: auto;
}
.mainContent {
flex: 1;
background-color: #2B50EC;
overflow-y: auto;
padding: 10px;
}but I basically what the blue part to be connected to the nav bar perfectly, however I cannot get it to work for some reason.
Swedish LapphundOP
so now its right under my navigation
Answer