Skip to content

Commit 11819d0

Browse files
committed
refactory: resolve a lots of warnings and code style issues
1 parent d4f19a7 commit 11819d0

File tree

58 files changed

+702
-696
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+702
-696
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 58 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/app/app.routes.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { Routes } from '@angular/router'
12
import { publicRoutes } from './routes/public.routes'
2-
import { defineRoutes } from './shared/tools'
33

4-
export const routes = defineRoutes([
4+
export const routes: Routes = [
55
{
66
path: '',
77
children: publicRoutes
@@ -10,4 +10,4 @@ export const routes = defineRoutes([
1010
path: 'admin',
1111
loadChildren: () => import('./routes/admin.routes').then((m) => m.adminRoutes)
1212
}
13-
])
13+
]

client/app/components/admin-header/admin-header.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,12 @@ export class AdminHeaderComponent {
1919

2020
public isSidebarOpen$
2121

22-
public readonly avatarUrl = `${API_BASE_URL2}/utils/qqavatar` // TODO: github avatar}
22+
public readonly avatarUrl = `${API_BASE_URL2}/utils/qqavatar` // TODO: github avatar
2323

2424
public constructor(
2525
private readonly authService: AuthService,
2626
private readonly layoutService: LayoutService
2727
) {
28-
this.authService.user$.subscribe((user) => {
29-
if (user) this.user = user
30-
})
3128
this.createDate = new Date((this.user?.created ?? 0) * 1000)
3229
this.isSidebarOpen$ = this.layoutService.isSidebarOpen$
3330
}

client/app/components/admin-layout/admin-layout.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { AsyncPipe } from '@angular/common'
21
import { Component, HostListener } from '@angular/core'
32
import { RouterOutlet } from '@angular/router'
43
import { BrowserService } from '../../services/browser.service'
@@ -10,7 +9,7 @@ import { AdminSidebarComponent } from '../admin-sidebar/admin-sidebar.component'
109
@Component({
1110
selector: 'app-admin-layout',
1211
standalone: true,
13-
imports: [AsyncPipe, RouterOutlet, AdminHeaderComponent, AdminSidebarComponent, AdminFooterComponent],
12+
imports: [RouterOutlet, AdminHeaderComponent, AdminSidebarComponent, AdminFooterComponent],
1413
templateUrl: './admin-layout.component.html'
1514
})
1615
export class AdminLayoutComponent {

client/app/components/footer/footer.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div class="text-right">
1818
<p>
1919
Made with ❤️ by
20-
<a class="text-blue-500 hover:text-blue-700" target=" _blank" class="" href="https://github.com/biyuehu">Arimura
20+
<a class="text-blue-500 hover:text-blue-700" target=" _blank" href="https://github.com/biyuehu">Arimura
2121
Sena</a>
2222
</p>
2323
<p>

client/app/components/footer/footer.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class FooterComponent implements OnInit {
2828
) {}
2929

3030
public ngOnInit() {
31+
if (!this.browserService.isBrowser) return
3132
this.apiService
3233
.getHitokoto()
3334
.pipe(

client/app/components/header/header.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="bg-black/50 backdrop-blur-10 z-3 fixed top-0 left-0 w-full">
22
<div class="mx-3 h-12 mx-0 px-0 py-1.5 lg:py-5 my-auto flex lg:justify-center items-center flex-1 relative h-full">
33
<div class="lg:hidden left-0 -translate-x-1 p-2" (click)="toggleMenu()">
4-
<img [src]="
4+
<img alt="hamburger" fill [ngSrc]="
55
isMenuOpen
66
? '/assets/hamburger_open.svg'
77
: '/assets/hamburger_close.svg'

client/app/components/header/header.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import { NgOptimizedImage } from '@angular/common'
12
import { Component } from '@angular/core'
23
import { RouterLink } from '@angular/router'
34

45
@Component({
56
selector: 'app-header',
67
standalone: true,
7-
imports: [RouterLink],
8+
imports: [RouterLink, NgOptimizedImage],
89
templateUrl: './header.component.html'
910
})
1011
export class HeaderComponent {

0 commit comments

Comments
 (0)