started sidebar implementation
This commit is contained in:
45
src/components/Sidebar.css
Normal file
45
src/components/Sidebar.css
Normal file
@ -0,0 +1,45 @@
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100vh;
|
||||
width: 250px;
|
||||
background-color: #fff;
|
||||
box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
|
||||
border-right: 1px solid #e5e7eb;
|
||||
}
|
||||
|
||||
.sidebar-header {
|
||||
padding: 1.5rem;
|
||||
border-bottom: 1px solid #e5e7eb;
|
||||
background-color: #f9fafb;
|
||||
}
|
||||
|
||||
.sidebar-title {
|
||||
margin: 0;
|
||||
font-size: 1.25rem;
|
||||
font-weight: 600;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.sidebar-nav {
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.sidebar-link {
|
||||
display: block;
|
||||
padding: 0.75rem 1.5rem;
|
||||
color: #374151;
|
||||
text-decoration: none;
|
||||
transition: background-color 0.2s ease;
|
||||
border-left: 3px solid transparent;
|
||||
}
|
||||
|
||||
.sidebar-link:hover {
|
||||
background-color: #f3f4f6;
|
||||
border-left-color: #3b82f6;
|
||||
}
|
||||
|
||||
.sidebar-link:active {
|
||||
background-color: #e5e7eb;
|
||||
}
|
||||
22
src/components/Sidebar.tsx
Normal file
22
src/components/Sidebar.tsx
Normal file
@ -0,0 +1,22 @@
|
||||
import React from 'react';
|
||||
import './Sidebar.css';
|
||||
|
||||
|
||||
const Sidebar: React.FC = () => {
|
||||
return (
|
||||
<div className="sidebar">
|
||||
<div className="sidebar-header">
|
||||
<h2 className="sidebar-title">Menu</h2>
|
||||
</div>
|
||||
|
||||
<nav className="sidebar-nav">
|
||||
<a href="/" className="sidebar-link">Home</a>
|
||||
<a href="/dashboard" className="sidebar-link">Dashboard</a>
|
||||
<a href="/settings" className="sidebar-link">Settings</a>
|
||||
<a href="/admin" className="sidebar-link">Admin</a>
|
||||
</nav>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default Sidebar;
|
||||
@ -1,7 +1,10 @@
|
||||
import Sidebar from "../../components/Sidebar";
|
||||
|
||||
const Dashboard = () => {
|
||||
return (
|
||||
<div>
|
||||
<h2>Dashboard</h2>
|
||||
<Sidebar/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user