Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 9 additions & 19 deletions apps/36-blocks/src/app/layout/layout.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
</div>
</div>
<button
matIconButton
class="mat-drawer-toggle-btn icon-btn-md mr-1"
matButton="tonal"
class="mat-drawer-toggle-btn mat-icon-32 !p-0 !min-w-0"
(click)="toggleSideBarEvent()"
[matTooltip]="(isSideNavOpen | async) ? 'Collapse Menu' : 'Expand Menu'"
matTooltipPosition="right"
type="button"
>
<mat-icon>{{
<mat-icon class="!m-0">{{
(isSideNavOpen | async) ? 'keyboard_double_arrow_left' : 'keyboard_double_arrow_right'
}}</mat-icon>
</button>
Expand All @@ -85,22 +85,6 @@
<!-- Proxy Sidenav::END -->
@if (logInData$ | async; as user) {
<div class="mat-drawer-footer mt-auto">
@if (isSideNavOpen | async) {
<div
class="flex items-center gap-2 px-4 py-2"
[matTooltip]="isDarkMode() ? 'Switch to Light Mode' : 'Switch to Dark Mode'"
matTooltipPosition="above"
>
<mat-slide-toggle
[checked]="isDarkMode()"
(change)="switchedDarkMode($event.checked)"
[class.hidden]="!(isSideNavOpen | async)"
[attr.aria-label]="isDarkMode() ? 'Switch to Light Mode' : 'Switch to Dark Mode'"
>
<span class="text-sm">{{ !isDarkMode() ? 'Light Mode' : 'Dark Mode' }}</span>
</mat-slide-toggle>
</div>
}
<button class="!rounded-lg" matButton [matMenuTriggerFor]="menu">
<div class="flex items-center">
@if (user.photoURL) {
Expand All @@ -118,6 +102,12 @@ <h6 [class.hidden]="!(isSideNavOpen | async)" class="username m-0">{{ user.displ
</button>
<mat-menu #menu="matMenu" class="profile-menu ml-1">
<h4 class="m-0 py-2 px-6 text-dark font-medium">{{ user.displayName }}</h4>
<div mat-menu-item class="flex items-center gap-2" (click)="switchedDarkMode(!isDarkMode())">
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dark mode toggle has been moved to the user menu, which improves the UI. However, the function call has changed from switchedDarkMode($event.checked) to switchedDarkMode(!isDarkMode()). Make sure the function can handle a direct boolean parameter instead of an event object.

<mat-icon class="mat-icon-18 material-icons-outlined">{{
isDarkMode() ? 'dark_mode' : 'light_mode'
}}</mat-icon>
<span>{{ isDarkMode() ? 'Dark Mode' : 'Light Mode' }}</span>
</div>
<a mat-menu-item class="flex items-center justify-between text-danger" (click)="logOut()">
Logout <mat-icon class="mat-icon-18 text-danger mr-0">logout</mat-icon>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
routerLinkActive="mdc-list-item--activated"
[matTooltipPosition]="'right'"
[matTooltip]="isSideNavOpen() ? item.label : ''"
[style.padding]="isSideNavOpen() ? '10px' : ''"
[style.padding]="isSideNavOpen() ? '8px' : ''"
>
<mat-icon matListIcon [class.mr-3]="!isSideNavOpen()" aria-hidden="false">{{ item.icon }}</mat-icon>
<span [class.hidden]="isSideNavOpen()" matLine>{{ item.label }}</span>
Expand Down
8 changes: 8 additions & 0 deletions apps/36-blocks/src/assets/scss/theme/_default-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,32 @@ html {
@include mat.all-component-themes(theme.$light-theme);
@include mat.system-level-colors(theme.$light-theme);
@include mat.system-level-typography(theme.$light-theme);
--mat-sys-outline: var(--color-common-border);
--mat-sys-on-surface: var(--proxy-neutral-40);
}

/* System default: follow OS dark mode when body has no theme class */
@media (prefers-color-scheme: dark) {
html:not(body.light-theme *):not(body.dark-theme *) {
@include mat.all-component-colors(theme.$dark-theme);
@include mat.system-level-colors(theme.$dark-theme);
--mat-sys-outline: var(--color-common-border);
--mat-sys-on-surface: var(--proxy-neutral-40);
}
}

/* Force dark theme */
body.dark-theme {
@include mat.all-component-colors(theme.$dark-theme);
@include mat.system-level-colors(theme.$dark-theme);
--mat-sys-outline: var(--color-common-border);
--mat-sys-on-surface: var(--proxy-neutral-40);
}

/* Force light theme (overrides OS dark preference) */
body.light-theme {
@include mat.all-component-colors(theme.$light-theme);
@include mat.system-level-colors(theme.$light-theme);
--mat-sys-outline: var(--color-common-border);
--mat-sys-on-surface: var(--proxy-neutral-40);
}
10 changes: 4 additions & 6 deletions apps/shared/scss/component/_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
.mat-mdc-header-row {
.mat-mdc-header-cell {
font-weight: 600;
font-size: 12px;
color: var(--color-table-head) !important;
border-bottom-color: var(--color-table-head-border) !important;
}
}

.mat-mdc-row {
.mat-mdc-cell {
border-bottom-color: var(--color-table-cell-border) !important;
}
// .mat-mdc-cell {
// border-bottom-color: var(--color-table-cell-border) !important;
// }
Comment on lines +22 to +24
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of commenting out CSS rules that are no longer needed, it would be better to remove them completely. Commented code adds maintenance burden and can cause confusion for other developers. If these styles need to be referenced later, they can be found in version control history.


&.highlight {
background-color: var(--color-common-bg-lighter);
Expand Down Expand Up @@ -105,7 +103,7 @@
height: auto !important;
width: 100%;
padding: 8px 16px !important;
border-bottom: 1px solid var(--color-table-cell-border) !important;
// border-bottom: 1px solid var(--color-table-cell-border) !important;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly here, if the border-bottom style is no longer needed, it should be removed rather than commented out.

box-sizing: border-box;
font-size: 13px;
word-break: break-word;
Expand Down
Loading