Skip to content

Commit 7170250

Browse files
WSS nav bar style changes (#658)
* WSS nav bar style changes * changes to show footer only at end * fix: update WSS nav bar icons and improve layout styles * fix: refactor content-wrapper to use ng-container for improved structure --------- Co-authored-by: tumms2021389 <[email protected]> Co-authored-by: Siva Rama Krishna <[email protected]>
1 parent 3fd5e81 commit 7170250

File tree

3 files changed

+92
-152
lines changed

3 files changed

+92
-152
lines changed

src/app/_samples/mediaco/components/wss-nav-bar/wss-nav-bar.component.html

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,35 @@
11
<mat-sidenav-container class="sidenav-container" autosize>
22
<mat-sidenav #drawer class="sidenav" mode="side" opened="true" [style.width]="collapsed ? '5rem' : '15rem'">
3-
<!-- Add [class.collapsed-mode]="collapsed" here -->
43
<mat-nav-list [class.collapsed-mode]="collapsed">
54
<!-- Toggle Button -->
6-
<div class="nav-item-container toggle-header" (click)="toggleMenu()">
5+
<div class="nav-menu-container toggle-header" (click)="toggleMenu()">
76
<button type="button" mat-icon-button [disableRipple]="true">
8-
<mat-icon>{{ collapsed ? 'menu' : 'cancel' }}</mat-icon>
7+
<mat-icon>{{ collapsed ? 'menu' : 'close' }}</mat-icon>
98
</button>
109
</div>
1110

1211
<!-- Home Button -->
13-
<!-- <div mat-list-item> -->
1412
<!-- Added 'nav-item-container' class for specific styling -->
15-
<div
16-
class="flex-box nav-item-container toggle-header"
17-
(click)="navPanelButtonClick(homePage)"
18-
[class.selected]="activePage === 'Self-service Main page'"
19-
>
13+
<div class="flex-box nav-item-container" (click)="navPanelButtonClick(homePage)" [class.selected]="activePage === 'Self-service Main page'">
2014
<button type="button" mat-icon-button [disableRipple]="true">
2115
<mat-icon>home</mat-icon>
2216
</button>
2317
<!-- Only show text if you want it in collapsed mode too, otherwise hide or style it -->
2418
<div mat-button class="psdk-nav-button-span">Home</div>
2519
</div>
26-
<!-- </div> -->
2720

2821
<!-- Dynamic Pages -->
29-
<div *ngFor="let page of navPages$">
30-
<div
31-
class="flex-box mat-list-item nav-item-container toggle-header"
32-
(click)="navPanelButtonClick(page)"
33-
[class.selected]="activePage === page.pyLabel"
34-
>
22+
<ng-container *ngFor="let page of navPages$">
23+
<div class="flex-box mat-list-item nav-item-container" (click)="navPanelButtonClick(page)" [class.selected]="activePage === page.pyLabel">
3524
<button type="button" mat-icon-button [disableRipple]="true">
3625
<mat-icon>dashboard</mat-icon>
3726
</button>
3827
<div mat-button class="psdk-nav-button-span">{{ page.pyDefaultHeading }}</div>
3928
</div>
40-
</div>
29+
</ng-container>
4130
</mat-nav-list>
4231
</mat-sidenav>
43-
<mat-sidenav-content [class.collapsed-mode]="collapsed">
32+
<mat-sidenav-content [class.collapsed-mode]="collapsed" class="page-container">
4433
<!-- Top Toolbar -->
4534

4635
<mat-toolbar style="position: sticky; top: 0; z-index: 10">
@@ -74,11 +63,11 @@
7463
</mat-toolbar-row>
7564
</mat-toolbar>
7665

77-
<div *ngFor="let kid of arChildren$">
78-
<div *ngIf="kid.getPConnect().getComponentName() == 'ViewContainer'">
66+
<ng-container *ngFor="let kid of arChildren$">
67+
<div *ngIf="kid.getPConnect().getComponentName() == 'ViewContainer'" class="content-wrapper">
7968
<component-mapper name="ViewContainer" [props]="{ pConn$: kid.getPConnect() }"></component-mapper>
8069
</div>
81-
</div>
70+
</ng-container>
8271
<app-footer></app-footer>
8372
</mat-sidenav-content>
8473
</mat-sidenav-container>

src/app/_samples/mediaco/components/wss-nav-bar/wss-nav-bar.component.scss

Lines changed: 82 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,25 @@
1111

1212
/* Ensure icons stay centered or aligned nicely when collapsed */
1313
mat-nav-list {
14-
padding-top: 0;
15-
}
16-
17-
.menu-item-text {
18-
margin-left: 10px;
19-
white-space: nowrap; /* Prevents text wrapping during animation */
20-
}
14+
padding-block: 2rem;
15+
padding-inline: 0.75rem;
16+
height: 100%;
17+
box-sizing: border-box;
18+
display: flex;
19+
flex-direction: column;
20+
gap: 0.75rem;
2121

22-
.content-padding {
23-
padding: 20px;
22+
&.collapsed-mode {
23+
padding-inline: 3.5px;
24+
align-items: center;
25+
}
2426
}
2527

2628
.horizontal-list {
2729
display: flex;
28-
flex-direction: row; /* This turns the list sideways */
2930
padding: 0;
30-
overflow-x: auto; /* Adds a scrollbar if items overflow */
31-
/* Control the exact distance between items here */
31+
overflow-x: auto;
3232
gap: 8px;
33-
34-
/* VITAL: Add a little vertical padding so the scaling doesn't hit the top/bottom edge */
35-
//padding: 10px 0;
36-
37-
/* Ensure the list itself doesn't hide the vertical overflow of the icons */
38-
//overflow-y: visible;
3933
}
4034

4135
/* Optional: Adjust item spacing */
@@ -44,18 +38,8 @@ mat-nav-list {
4438

4539
/* vital: overrides Angular Material's default item padding */
4640
padding: 0 !important;
47-
48-
//overflow: visible !important; /* Allow the icon to expand outside this box */
49-
//position: relative; /* Required for z-index to work */
5041
}
5142

52-
/* Targeted fix for the internal container (common in many Angular Material versions) */
53-
// .horizontal-list mat-list-item ::ng-deep .mat-list-item-content {
54-
// justify-content: center !important; /* Horizontally center */
55-
// align-items: center !important; /* Vertically center */
56-
// display: flex !important;
57-
// }
58-
5943
/* 1. Make the animation smooth */
6044
.horizontal-list mat-list-item .circle-icon {
6145
transition: transform 0.2s ease-in-out;
@@ -68,11 +52,6 @@ mat-nav-list {
6852
cursor: pointer; /* Changes cursor to pointer to indicate interactivity */
6953
}
7054

71-
// .horizontal-list mat-list-item:hover {
72-
// /* High z-index ensures the scaled icon floats ON TOP of its neighbors */
73-
// z-index: 100;
74-
// }
75-
7655
.circle-icon {
7756
/* 1. Make it a circle */
7857
background: linear-gradient(135deg, rgb(255, 179, 217) 0%, rgb(255, 196, 232) 100%);
@@ -97,49 +76,80 @@ mat-nav-list {
9776
.nav-item-container {
9877
display: flex;
9978
align-items: center;
100-
width: 100%;
101-
padding: 8px 0;
79+
justify-content: flex-start;
10280
transition: all 0.2s ease-in-out;
10381
cursor: pointer;
104-
105-
/*
106-
EXPANDED MODE (Default)
107-
Icon left, Text right
108-
*/
109-
flex-direction: row;
110-
justify-content: flex-start;
111-
text-align: left;
82+
padding: 8px 8px;
11283

11384
.psdk-nav-button-span {
114-
margin-left: 10px; /* Spacing between icon and text */
11585
opacity: 1;
11686
display: block;
11787
}
11888

11989
::ng-deep .mat-mdc-button-persistent-ripple::before {
12090
background-color: transparent !important;
12191
}
92+
93+
&:hover,
94+
&.active,
95+
&.focus,
96+
&.selected {
97+
border-radius: 16px;
98+
border-color: #3f51b5; /* Change to your preferred color (e.g., primary) */
99+
background-color: rgba(63, 81, 181, 0.1); /* Optional: slight background tint */
100+
}
101+
102+
&.selected {
103+
color: #6750a4;
104+
mat-icon {
105+
color: #6750a4;
106+
}
107+
}
122108
}
123109

124-
/*
125-
COLLAPSED MODE
126-
Icon top, Text bottom, Centered
127-
*/
110+
.nav-menu-container {
111+
display: flex;
112+
justify-content: center;
113+
align-items: center;
114+
width: 56px;
115+
height: 56px;
116+
border-radius: 16px;
117+
border-color: #3f51b5; /* Change to your preferred color (e.g., primary) */
118+
background-color: rgba(63, 81, 181, 0.1);
119+
120+
button {
121+
display: flex;
122+
align-items: center;
123+
justify-content: center;
124+
}
125+
126+
::ng-deep .mat-mdc-button-persistent-ripple::before {
127+
background-color: transparent !important;
128+
}
129+
}
130+
131+
.collapsed-mode .nav-menu-container {
132+
margin-inline: 0.75rem;
133+
}
134+
135+
/* COLLAPSED MODE */
128136
.collapsed-mode .nav-item-container {
129137
flex-direction: column; /* Stacks items vertically */
130138
justify-content: center;
131139
align-items: center;
132140
text-align: center;
133-
// height: 5rem;
141+
width: 100%;
142+
padding: 8px 0px;
134143

135144
/* Adjust text for small space */
136145
.psdk-nav-button-span {
137146
margin-left: 0;
138147
margin-top: 4px; /* Spacing between icon and text */
139-
font-size: 0.85rem; /* Smaller text to fit 5rem width */
148+
font-size: 12px; /* Smaller text to fit 5rem width */
140149
line-height: 1.2;
141150
white-space: normal; /* Allow wrapping if needed */
142151
max-width: 100%;
152+
padding-left: revert;
143153
}
144154
}
145155

@@ -151,41 +161,6 @@ mat-nav-list {
151161
margin-left: 5.313rem !important;
152162
}
153163

154-
/* Optional: Add spacing below the toggle button if needed */
155-
.toggle-header {
156-
margin-bottom: 10px;
157-
}
158-
159-
/*
160-
ICON BORDER STYLES
161-
Apply to the mat-icon-button inside the container
162-
*/
163-
// .nav-item-container button[mat-icon-button] {
164-
// /* Add transparent border initially to prevent layout shift on hover */
165-
// border: 2px solid transparent;
166-
// border-radius: 50%; /* Ensure the border is circular */
167-
// transition:
168-
// border-color 0.2s ease,
169-
// background-color 0.2s;
170-
// }
171-
172-
/* Hover and Active states for the Icon */
173-
// .nav-item-container:hover button[mat-icon-button],
174-
// .nav-item-container button[mat-icon-button]:active,
175-
// .nav-item-container button[mat-icon-button]:focus {
176-
// border-color: #3f51b5; /* Change to your preferred color (e.g., primary) */
177-
// background-color: rgba(63, 81, 181, 0.1); /* Optional: slight background tint */
178-
// }
179-
180-
.nav-item-container:hover,
181-
.nav-item-container:active,
182-
.nav-item-container:focus,
183-
.nav-item-container.selected {
184-
border-radius: 16px;
185-
border-color: #3f51b5; /* Change to your preferred color (e.g., primary) */
186-
background-color: rgba(63, 81, 181, 0.1); /* Optional: slight background tint */
187-
}
188-
189164
.mat-drawer-container,
190165
.mat-drawer {
191166
background-color: #fef7ff !important;
@@ -198,3 +173,25 @@ mat-nav-list {
198173
::ng-deep .custom-menu-no-padding .mat-mdc-menu-content {
199174
padding: 0 !important;
200175
}
176+
177+
/*
178+
* Apply flexbox to the mat-sidenav-content to control the layout of its direct children.
179+
* We're also ensuring it takes up at least the full height of the viewport.
180+
*/
181+
.page-container {
182+
display: flex;
183+
flex-direction: column;
184+
min-height: 100vh;
185+
186+
.mat-toolbar-multiple-rows {
187+
padding-top: 5px;
188+
}
189+
}
190+
191+
/*
192+
* This tells the main content area to grow and take up any available
193+
* free space, which pushes the footer down.
194+
*/
195+
.content-wrapper {
196+
flex: 1;
197+
}

0 commit comments

Comments
 (0)