refactor: redesign sidebar component

This commit is contained in:
--remove-section committed 2026-01-29 21:36:13 +05:30
1 parent 6f2d5a5627
commit 691df70aff
9 files changed
+487 -330

No files matched your search

+93 -23
View File
@@ -1,3 +1,5 @@
@use "../../styles/variables.scss" as *;
.settings {
&-page {
&-container {
@@ -51,46 +53,114 @@
}
&-sidebar {
// padding-top: 4.4em !important;
display: flex;
flex-direction: column;
align-items: center;
align-items: stretch;
justify-content: flex-start;
background: rgb(0 0 0 / 0.4);
border-right: 1px solid rgba(255, 255, 255, 0.12);
// padding-top: 1em;s
background: $clr-background-dark;
border-right: 1px solid rgba(255, 255, 255, 0.05);
padding: 1.5em 1em; // Reduced padding
gap: 1em; // Reduced gap
&-controls {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
gap: 0.5em;
width: 100%;
padding: 1em;
justify-content: space-between;
padding-bottom: 0.5em; // Reduced
// Adjust back button for this context
.MuiIconButton-root {
color: rgba(255,255,255,0.7);
&:hover {
color: white;
background: rgba(255,255,255,0.05);
}
}
}
&-header {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
width: 100%;
padding: 1em;
flex-direction: row;
gap: 1em;
text-align: center;
gap: 0.75em;
padding: 1em; // Reduced padding
background: rgba(255, 255, 255, 0.03);
border-radius: 16px; // Slightly tighter radius
border: 1px solid rgba(255, 255, 255, 0.05);
transition: all 0.3s ease;
&:hover {
background: rgba(255, 255, 255, 0.05);
border-color: rgba(255, 255, 255, 0.1);
transform: translateY(-2px);
}
&-image {
$size: 3em;
$size: 3.5em; // Reduced size slightly (was 4.5em)
width: $size;
height: $size;
border-radius: 50%;
object-fit: cover;
border: 3px solid rgba(0,0,0,0.2);
box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}
}
&-list-item {
width: 100%;
.MuiButtonBase-root {
border-radius: 5px !important;
&-list {
display: flex;
flex-direction: column;
gap: 0.25em;
// Section headers
.MuiTypography-overline {
color: rgba(255,255,255,0.4);
font-size: 0.7rem;
margin-top: 1em; // Reduced
margin-bottom: 0.25em; // Reduced
padding-left: 12px;
}
&.active .MuiButtonBase-root {
--fill: 1;
background: $clr-gradient-default;
&-item {
.MuiButtonBase-root {
border-radius: 12px !important;
padding: 8px 12px !important; // Reduced padding
transition: all 0.2s ease;
color: rgba(255,255,255,0.6);
font-weight: 500;
&:hover {
background: rgba(255, 255, 255, 0.05);
color: rgba(255,255,255,0.9);
}
.material-symbols-rounded {
margin-right: 12px;
opacity: 0.7;
font-size: 20px; // Slightly smaller icons
}
}
&.active .MuiButtonBase-root {
background: rgba($clr-accent-default, 0.1) !important;
color: $clr-accent-default;
font-weight: 600;
.material-symbols-rounded {
opacity: 1;
font-variation-settings: 'FILL' 1;
}
&::after {
content: '';
position: absolute;
right: 12px;
width: 6px;
height: 6px;
border-radius: 50%;
background: currentColor;
}
}
}
}
}
+43 -8
View File
@@ -30,11 +30,17 @@ function SettingsRoute() {
<div className="settings-sidebar">
<div className="settings-sidebar-controls">
<BackButton />
<IconButton onClick={handleNavigateHome}>
<IconButton
onClick={handleNavigateHome}
sx={{
background: "rgba(255, 255, 255, 0.05)",
"&:hover": { background: "rgba(255, 255, 255, 0.1)" },
}}
>
<span className="material-symbols-rounded">home</span>
</IconButton>
</div>
<Divider flexItem />
<div className="settings-sidebar-header">
<img
className="settings-sidebar-header-image"
@@ -42,21 +48,36 @@ function SettingsRoute() {
alt="user"
/>
<div className="flex flex-column">
<Typography variant="h6">{user?.Name}</Typography>
<Typography variant="caption" style={{ opacity: 0.5 }}>
{user?.Policy?.IsAdministrator ? "administrator" : "user"}
<Typography variant="h6" fontWeight="bold">
{user?.Name}
</Typography>
<Typography variant="body2" sx={{ opacity: 0.5 }}>
{user?.Policy?.IsAdministrator ? "Administrator" : "User"}
</Typography>
</div>
</div>
<Divider flexItem variant="middle" />
<List
component="nav"
aria-label="main mailbox folders"
aria-label="settings navigation"
className="settings-sidebar-list"
style={{
sx={{
width: "100%",
padding: 0,
}}
>
<Typography
variant="overline"
sx={{
px: 2,
py: 1,
opacity: 0.5,
fontWeight: "bold",
letterSpacing: "0.1em",
}}
>
General
</Typography>
<ListItemLink
to="/settings/preferences"
icon="tune"
@@ -69,6 +90,20 @@ function SettingsRoute() {
primary="Servers"
className="settings-sidebar-list-item"
/>
<Typography
variant="overline"
sx={{
px: 2,
py: 1,
mt: 2,
opacity: 0.5,
fontWeight: "bold",
letterSpacing: "0.1em",
}}
>
System
</Typography>
<ListItemLink
to="/settings/about"
icon="info"
@@ -264,6 +264,7 @@ function ChangeServerRoute() {
border: "1px solid rgba(211, 47, 47, 0.8)",
},
}}
disabled={isActive}
>
<span className="material-symbols-rounded">delete</span>
</Button>