fix: material 18
This commit is contained in:
@@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MessageComponent } from './message.component';
|
||||
import { AdminCommService } from 'src/app/admin-view/admin-comm.service';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import * as moment from 'moment';
|
||||
import moment from 'moment';
|
||||
|
||||
describe('MessageComponent', () => {
|
||||
let component: MessageComponent;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { inject } from '@angular/core';
|
||||
import { CanActivateChildFn, Router } from '@angular/router';
|
||||
import { CanActivateChildFn, RedirectCommand, Router } from '@angular/router';
|
||||
import { LocalStorageService } from './services/local-storage.service';
|
||||
|
||||
export const adminGuard: CanActivateChildFn = (childRoute, state) => {
|
||||
const router = inject(Router)
|
||||
if (inject(LocalStorageService).admin == undefined) return router.parseUrl('/')
|
||||
if (inject(LocalStorageService).admin == undefined) return new RedirectCommand(router.parseUrl('/'))
|
||||
return true
|
||||
};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { inject } from '@angular/core';
|
||||
import { CanActivateChildFn, Router } from '@angular/router';
|
||||
import { CanActivateChildFn, RedirectCommand, Router } from '@angular/router';
|
||||
import { LocalStorageService } from './services/local-storage.service';
|
||||
|
||||
export const authGuard: CanActivateChildFn = (childRoute, state) => {
|
||||
const router = inject(Router)
|
||||
if (!inject(LocalStorageService).loggedIn) return router.parseUrl('/login')
|
||||
if (!inject(LocalStorageService).loggedIn) return new RedirectCommand(router.parseUrl('/login'))
|
||||
return true
|
||||
};
|
||||
|
||||
@@ -62,15 +62,15 @@ $accent-palette: (
|
||||
// Define the palettes for your theme using the Material Design palettes available in palette.scss
|
||||
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
|
||||
// hue. Available color palettes: https://material.io/design/color/
|
||||
$ipwa-primary: mat.define-palette($ipwa-palette, 700, 400, 900);
|
||||
$ipwa-accent: mat.define-palette($accent-palette, 700, 400, 900);
|
||||
$ipwa-primary: mat.m2-define-palette($ipwa-palette, 700, 400, 900);
|
||||
$ipwa-accent: mat.m2-define-palette($accent-palette, 700, 400, 900);
|
||||
|
||||
// The warn palette is optional (defaults to red).
|
||||
$ipwa-warn: mat.define-palette(mat.$red-palette);
|
||||
$ipwa-warn: mat.m2-define-palette(mat.$m2-red-palette);
|
||||
|
||||
// Create the theme object. A theme consists of configurations for individual
|
||||
// theming systems such as "color" or "typography".
|
||||
$ipwa-theme: mat.define-light-theme((
|
||||
$ipwa-theme: mat.m2-define-light-theme((
|
||||
color: (
|
||||
primary: $ipwa-primary,
|
||||
accent: $ipwa-accent,
|
||||
@@ -78,7 +78,7 @@ $ipwa-theme: mat.define-light-theme((
|
||||
)
|
||||
));
|
||||
|
||||
$ipwa-dark: mat.define-dark-theme((
|
||||
$ipwa-dark: mat.m2-define-dark-theme((
|
||||
color: (
|
||||
primary: $ipwa-primary,
|
||||
accent: $ipwa-accent,
|
||||
|
||||
Reference in New Issue
Block a user