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
12 changes: 6 additions & 6 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "1.0.16",
"version": "1.0.20",
"scripts": {
"install:deps": "npm install",
"start": "npm install && ng serve --configuration local --open",
Expand Down Expand Up @@ -42,7 +42,7 @@
"@ngrx/router-store": "^17.2.0",
"@ngrx/store": "^17.2.0",
"@nguniversal/express-engine": "^7.0.2",
"@openmina/shared": "^0.107.0",
"@openmina/shared": "^0.108.0",
"@sentry/angular": "^8.35.0",
"@sentry/cli": "^2.38.2",
"@sentry/tracing": "^7.114.0",
Expand Down
30 changes: 18 additions & 12 deletions frontend/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,32 @@
<mat-sidenav-container [hasBackdrop]="false"
class="w-100 h-100"
*ngIf="menu$ | async as menu">
<mat-sidenav [mode]="menu.isMobile ? 'over' : 'side'"
[class.opened]="menu.open"
[class.collapsed]="menu.collapsed"
[class.mobile]="menu.isMobile">
<mina-menu></mina-menu>
<div class="backdrop" (click)="toggleMenu()"></div>
</mat-sidenav>
@if (isDesktop) {
<mat-sidenav mode="side"
[class.opened]="menu.open"
[class.collapsed]="menu.collapsed"
[class.mobile]="menu.isMobile">
<mina-menu></mina-menu>
<div class="backdrop" (click)="toggleMenu()"></div>
</mat-sidenav>
}
<mat-sidenav-content class="flex-column"
[style.margin-left.px]="menu.isMobile ? 0 : (menu.collapsed ? 44 : 160)">
<mina-toolbar *ngIf="!hideToolbar"></mina-toolbar>
@if (!hideToolbar) {
<mina-toolbar></mina-toolbar>
}
<div class="mina-content"
[class.no-toolbar]="hideToolbar"
[class.no-submenus]="subMenusLength < 2"
[class.mobile]="menu.isMobile">
<router-outlet></router-outlet>
</div>
<mina-submenu-tabs *ngIf="menu.isMobile"
[class.d-none]="subMenusLength < 2"
class="mobile-menu border-top"
(subMenusLength)="onSubmenusLengthChange($event)"></mina-submenu-tabs>
@if (!isDesktop) {
<mina-submenu-tabs [class.d-none]="subMenusLength < 2"
class="mobile-menu border-top"
(subMenusLength)="onSubmenusLengthChange($event)"></mina-submenu-tabs>
<mina-menu-tabs></mina-menu-tabs>
}
</mat-sidenav-content>
</mat-sidenav-container>
}
11 changes: 7 additions & 4 deletions frontend/src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ mat-sidenav {
}

mat-sidenav-content {
transition: 200ms ease-out !important;
@media (min-width: 768px) {
transition: 200ms ease-out !important;
}
overflow: hidden;
}

Expand All @@ -69,14 +71,15 @@ mat-sidenav-content {
&.mobile {
$toolbar: 56px;
$subMenus: 56px;
height: calc(100% - #{$toolbar} - #{$subMenus});
$tabs: 56px;
height: calc(100% - #{$toolbar} - #{$subMenus} - #{$tabs});

&.no-toolbar {
height: calc(100% - #{$subMenus});
height: calc(100% - #{$subMenus} - #{$tabs});
}

&.no-submenus {
height: calc(100% - #{$toolbar});
height: calc(100% - #{$toolbar} - #{$tabs});

&.no-toolbar {
height: 100%;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { any, getMergedRoute, getWindow, isBrowser, MAX_WIDTH_700, MergedRoute, safelyExecuteInBrowser } from '@openmina/shared';
import { any, getMergedRoute, getWindow, isBrowser, isDesktop, MAX_WIDTH_700, MergedRoute, safelyExecuteInBrowser } from '@openmina/shared';
import { AppMenu } from '@shared/types/app/app-menu.type';
import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';
import { AppSelectors } from '@app/app.state';
Expand All @@ -26,6 +26,7 @@ export class AppComponent extends StoreDispatcher implements OnInit {
subMenusLength: number = 0;
hideToolbar: boolean = CONFIG.hideToolbar;
loaded: boolean;
isDesktop: boolean = isDesktop();

private nodeUpdateSubscription: Subscription | null = null;

Expand Down
5 changes: 5 additions & 0 deletions frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { initializeApp, provideFirebaseApp } from '@angular/fire/app';
import { getAnalytics, provideAnalytics, ScreenTrackingService } from '@angular/fire/analytics';
import { getPerformance, providePerformance } from '@angular/fire/performance';
import { BlockProductionPillComponent } from '@app/layout/block-production-pill/block-production-pill.component';
import { MenuTabsComponent } from '@app/layout/menu-tabs/menu-tabs.component';

registerLocaleData(localeFr, 'fr');
registerLocaleData(localeEn, 'en');
Expand Down Expand Up @@ -161,6 +162,7 @@ export class AppGlobalErrorhandler implements ErrorHandler {
CopyComponent,
WebNodeLandingPageComponent,
BlockProductionPillComponent,
MenuTabsComponent,
],
providers: [
THEME_PROVIDER,
Expand Down Expand Up @@ -195,5 +197,8 @@ export class AppGlobalErrorhandler implements ErrorHandler {
providePerformance(() => getPerformance()),
],
bootstrap: [AppComponent],
exports: [
MenuComponent,
],
})
export class AppModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const getSlotsSuccess = createAction(type('Get Slots Success'), props<{
}>());
const changeFilters = createAction(type('Change Filters'), props<{ filters: BlockProductionWonSlotsFilters }>());
const setActiveSlot = createAction(type('Set Active Slot'), props<{ slot: BlockProductionWonSlotsSlot }>());
const setActiveSlotNumber = createAction(type('Set Active Slot Number'), props<{ slotNumber: number }>());
const sort = createAction(type('Sort'), props<{ sort: TableSort<BlockProductionWonSlotsSlot> }>());
const toggleSidePanel = createAction(type('Toggle Side Panel'));

Expand All @@ -36,6 +37,7 @@ export const BlockProductionWonSlotsActions = {
getSlotsSuccess,
changeFilters,
setActiveSlot,
setActiveSlotNumber,
sort,
toggleSidePanel,
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class BlockProductionWonSlotsEffects extends BaseEffect {

readonly init$: Effect;
readonly getSlots$: Effect;
readonly setActiveSlotNumber$: Effect;

constructor(private router: Router,
private actions$: Actions,
Expand Down Expand Up @@ -79,5 +80,13 @@ export class BlockProductionWonSlotsEffects extends BaseEffect {
activeSlot: undefined,
})),
));

this.setActiveSlotNumber$ = createEffect(() => this.actions$.pipe(
ofType(BlockProductionWonSlotsActions.setActiveSlotNumber),
this.latestActionState(),
map(({ action, state }) => BlockProductionWonSlotsActions.setActiveSlot({
slot: state.blockProduction[BLOCK_PRODUCTION_WON_SLOTS_KEY].slots.find(s => s.globalSlot === action.slotNumber),
})),
));
}
}
2 changes: 2 additions & 0 deletions frontend/src/app/features/dashboard/dashboard.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { DashboardBlocksSyncComponent } from './dashboard-blocks-sync/dashboard-
import {
DashboardPeersMinimalTableComponent,
} from './dashboard-peers-minimal-table/dashboard-peers-minimal-table.component';
import { BlockProductionPillComponent } from '@app/layout/block-production-pill/block-production-pill.component';


@NgModule({
Expand All @@ -33,6 +34,7 @@ import {
EffectsModule.forFeature(DashboardEffects),
LoadingSpinnerComponent,
CopyComponent,
BlockProductionPillComponent,
],
})
export class DashboardModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,18 @@ $white: #000000;
button {
width: 158px;
height: 48px !important;
background-color: $cta-container;
color: $base-background;
background-color: $base-background;
color: $base-primary;
filter: invert(1);

&.disabled {
opacity: 0.25;
pointer-events: none;
}

&:hover:not(.disabled) {
background-color: $selected-primary;
}
}

@media (max-width: 768px) {
border: none !important;
> div {
display: none;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
<div class="pill w-100 text-nowrap border-rad-6 fx-row-vert-cent pointer" (click)="goToWonSlots()">
<div class="pill-inside w-100 h-100 border-rad-6 fx-row-vert-cent pr-5">
<span class="mina-icon icon-300 f-18 mr-5">schedule</span>
<div class="bp">Block Production&nbsp;</div>
<div class="time">
@if (text) {
{{ text }}
} @else {
{{ producingIn ? ('in ' + producingIn) : 'in ...' }}
}</div>
<div class="pill comet-border w-100 h-100 text-nowrap border-rad-6 fx-row-vert-cent pointer"
(click)="goToWonSlots()">
<div class="pill-inside1 border-rad-6 fx-row-vert-cent">
<div class="pill-inside2 w-100 h-100 border-rad-6 fx-row-vert-cent pr-5">
@if (!isMobile) {
<span class="mina-icon icon-300 f-18 mr-5">schedule</span>
}
<div class="bp f-600 truncate">Block Production&nbsp;</div>
<div class="time">
@if (text) {
{{ text }}
} @else {
@if (producingIn) {
<strong>in</strong>
{{ producingIn }}
} @else {
<strong>in ...</strong>
}
}</div>
</div>
</div>
</div>
Loading
Loading