File tree 8 files changed +76
-18
lines changed
apps/code-review/src/app/pages/overview
8 files changed +76
-18
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "**/*.html": ["npx prettier **/*.html --write", "git add" ],
2
+ "**/*.html": ["npx prettier **/*.html --write"],
3
3
"**/*.scss": [
4
4
"npx prettier **/*.scss --write",
5
- "stylelint --fix",
6
- "git add"
5
+ "stylelint --fix"
7
6
],
8
7
"**/*.ts": [
9
8
"npx prettier **/*.ts --write",
10
- "eslint **/*.ts --fix",
11
- "git add"
9
+ "eslint **/*.ts --fix"
12
10
]
13
11
}
Original file line number Diff line number Diff line change 1
- < button mat-icon-button class ="btn-menu ">
1
+ < button mat-icon-button class ="btn-menu " (click) =" toggleFileExplorer.emit() " >
2
2
< mat-icon class ="btn-menu-icon "> menu</ mat-icon >
3
3
</ button >
4
4
Original file line number Diff line number Diff line change 30
30
.block-request {
31
31
width : 300px ;
32
32
height : 53px ;
33
- z-index : 1 ;
33
+ z-index : 10 ;
34
34
35
35
.panel-request {
36
36
background-color : #212121 ;
Original file line number Diff line number Diff line change 1
- import { ChangeDetectionStrategy , Component } from '@angular/core' ;
1
+ import {
2
+ ChangeDetectionStrategy ,
3
+ Component ,
4
+ Output ,
5
+ EventEmitter
6
+ } from '@angular/core' ;
2
7
import { DeviceDetectorService } from 'ngx-device-detector' ;
3
8
import { MatDialog } from '@angular/material/dialog' ;
4
9
import { ReviewRequestDetailsWindowComponent } from './review-request-details-window' ;
@@ -12,6 +17,8 @@ import { ReviewRequestDetailsWindowComponent } from './review-request-details-wi
12
17
export class HeaderComponent {
13
18
public readonly isMobile = this . deviceService . isMobile ( ) ;
14
19
20
+ @Output ( ) public toggleFileExplorer = new EventEmitter < boolean > ( ) ;
21
+
15
22
constructor (
16
23
private readonly deviceService : DeviceDetectorService ,
17
24
private readonly dialog : MatDialog
Original file line number Diff line number Diff line change 1
- < acua-header class ="header "> </ acua-header >
1
+ < acua-header
2
+ class ="header "
3
+ (toggleFileExplorer) ="toggleFileExplorer() "
4
+ > </ acua-header >
2
5
3
- < div class ="container ">
4
- < acua-file-explorer
5
- [tree] ="tree "
6
- class ="file-explorer "
7
- (fileSelected) ="onFileSelected($event) "
8
- > </ acua-file-explorer >
6
+ < mat-drawer-container class ="container ">
7
+ < mat-drawer
8
+ mode ="side "
9
+ class ="mat-drawer-desktop "
10
+ *ngIf ="!isMobile "
11
+ [opened] ="isFileExplorerOpenDesktop "
12
+ >
13
+ < acua-file-explorer
14
+ [tree] ="tree "
15
+ class ="file-explorer "
16
+ (fileSelected) ="onFileSelected($event) "
17
+ > </ acua-file-explorer >
18
+ </ mat-drawer >
19
+ < mat-drawer-content >
20
+ < acua-code-editor class ="code-editor "> </ acua-code-editor >
21
+ </ mat-drawer-content >
9
22
10
- < acua-code-editor class ="code-editor "> </ acua-code-editor >
11
- </ div >
23
+ < mat-drawer
24
+ mode ="over "
25
+ class ="mat-drawer-mobile "
26
+ *ngIf ="isMobile "
27
+ [opened] ="isFileExplorerOpenMobile "
28
+ >
29
+ < acua-file-explorer
30
+ [tree] ="tree "
31
+ class ="file-explorer "
32
+ (fileSelected) ="onFileSelected($event) "
33
+ > </ acua-file-explorer >
34
+ </ mat-drawer >
35
+ < mat-drawer-content >
36
+ < acua-code-editor class ="code-editor "> </ acua-code-editor >
37
+ </ mat-drawer-content >
38
+ </ mat-drawer-container >
Original file line number Diff line number Diff line change 11
11
}
12
12
13
13
.container {
14
- display : flex ;
15
14
flex : 1 ;
16
15
overflow : hidden ;
16
+
17
+ mat-drawer {
18
+ background-color : #202327 ;
19
+ border : 0 ;
20
+ }
21
+
22
+ .mat-drawer-desktop {
23
+ min-width : 15% ;
24
+ resize : horizontal ;
25
+ }
26
+
27
+ .mat-drawer-mobile {
28
+ width : 75% ;
29
+ }
17
30
}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { MonacoTreeFileNode } from '@code-review/shared';
8
8
import { CodeEditorComponent } from './components' ;
9
9
import { SOURCE_CODE_PROVIDER } from './providers' ;
10
10
import { SOURCE_CODE } from './tokens' ;
11
+ import { DeviceDetectorService } from 'ngx-device-detector' ;
11
12
12
13
@Component ( {
13
14
selector : 'acua-overview' ,
@@ -18,11 +19,21 @@ import { SOURCE_CODE } from './tokens';
18
19
} )
19
20
export class OverviewComponent {
20
21
public tree = inject ( SOURCE_CODE ) ;
22
+ public readonly isMobile = this . deviceService . isMobile ( ) ;
23
+ public isFileExplorerOpenMobile = false ;
24
+ public isFileExplorerOpenDesktop = true ;
21
25
22
26
@ViewChild ( CodeEditorComponent )
23
27
private readonly codeEditor ! : CodeEditorComponent ;
24
28
29
+ constructor ( private readonly deviceService : DeviceDetectorService ) { }
30
+
25
31
public onFileSelected ( node : MonacoTreeFileNode ) : void {
26
32
this . codeEditor . openFile ( node . fullPath , node . content ) ;
27
33
}
34
+
35
+ public toggleFileExplorer ( ) : void {
36
+ this . isFileExplorerOpenMobile = ! this . isFileExplorerOpenMobile ;
37
+ this . isFileExplorerOpenDesktop = ! this . isFileExplorerOpenDesktop ;
38
+ }
28
39
}
Original file line number Diff line number Diff line change 6
6
FileExplorerModule ,
7
7
HeaderModule
8
8
} from './components' ;
9
+ import { MatSidenavModule } from '@angular/material/sidenav' ;
9
10
import { OverviewComponent } from './overview.component' ;
10
11
import { OVERVIEW_ROUTES } from './overview.routes' ;
11
12
import {
@@ -22,6 +23,7 @@ import { ReviewRequestCommentsState } from './states';
22
23
FileExplorerModule ,
23
24
HeaderModule ,
24
25
CodeEditorModule ,
26
+ MatSidenavModule ,
25
27
RouterModule . forChild ( OVERVIEW_ROUTES )
26
28
] ,
27
29
providers : [
You can’t perform that action at this time.
0 commit comments