@@ -12,24 +12,18 @@ import { h } from '@phosphor/virtualdom/lib';
12
12
13
13
export class ExtensionDetailWidget extends VirtualWidget {
14
14
15
- constructor ( id : string ,
16
- protected resolvedExtension : ResolvedExtension ) {
15
+ constructor (
16
+ protected readonly resolvedExtension : ResolvedExtension
17
+ ) {
17
18
super ( ) ;
18
- this . id = id ;
19
19
this . addClass ( 'theia-extension-detail' ) ;
20
- this . title . closable = true ;
21
- this . title . label = resolvedExtension . name ;
22
-
23
- resolvedExtension . resolve ( ) . then ( rex => {
24
- this . update ( ) ;
25
- } ) ;
26
-
27
20
28
21
resolvedExtension . onDidChange ( change => {
29
22
if ( change . name === this . resolvedExtension . name ) {
30
23
this . update ( ) ;
31
24
}
32
25
} ) ;
26
+ this . update ( ) ;
33
27
}
34
28
35
29
protected onUpdateRequest ( msg : Message ) : void {
@@ -44,25 +38,25 @@ export class ExtensionDetailWidget extends VirtualWidget {
44
38
protected render ( ) : h . Child {
45
39
const r = this . resolvedExtension ;
46
40
47
- const name = h . h2 ( { className : 'extensionName' } , r . name ) ;
48
- const extversion = h . div ( { className : 'extensionVersion' } , r . version ) ;
49
- const author = h . div ( { className : 'extensionAuthor' } , r . author ) ;
50
- const titleInfo = h . div ( { className : 'extensionSubtitle' } , author , extversion ) ;
51
- const titleContainer = h . div ( { className : 'extensionTitleContainer' } ,
41
+ const name = h . h2 ( { className : 'extensionName' } , r . name ) ;
42
+ const extversion = h . div ( { className : 'extensionVersion' } , r . version ) ;
43
+ const author = h . div ( { className : 'extensionAuthor' } , r . author ) ;
44
+ const titleInfo = h . div ( { className : 'extensionSubtitle' } , author , extversion ) ;
45
+ const titleContainer = h . div ( { className : 'extensionTitleContainer' } ,
52
46
name , titleInfo ) ;
53
47
54
- const description = h . div ( { className : 'extensionDescription' } , r . description ) ;
48
+ const description = h . div ( { className : 'extensionDescription' } , r . description ) ;
55
49
56
- const buttonRow = h . div ( { className : 'extensionButtonRow' } ,
50
+ const buttonRow = h . div ( { className : 'extensionButtonRow' } ,
57
51
VirtualRenderer . flatten ( this . createButtons ( this . resolvedExtension ) ) ) ;
58
52
59
- const buttonContainer = h . div ( { className : 'extensionButtonContainer' } , buttonRow ) ;
53
+ const buttonContainer = h . div ( { className : 'extensionButtonContainer' } , buttonRow ) ;
60
54
61
- const headerContainer = h . div ( { className : 'extensionHeaderContainer' } ,
55
+ const headerContainer = h . div ( { className : 'extensionHeaderContainer' } ,
62
56
titleContainer , description , buttonContainer ) ;
63
57
64
- const documentation = h . div ( { className : 'extensionDocumentation' , id : this . id + 'Doc' } , '' ) ;
65
- const docContainer = h . div ( { className : 'extensionDocContainer flexcontainer' } , documentation ) ;
58
+ const documentation = h . div ( { className : 'extensionDocumentation' , id : this . id + 'Doc' } , '' ) ;
59
+ const docContainer = h . div ( { className : 'extensionDocContainer flexcontainer' } , documentation ) ;
66
60
67
61
return [ headerContainer , docContainer ] ;
68
62
}
@@ -74,7 +68,7 @@ export class ExtensionDetailWidget extends VirtualWidget {
74
68
btnLabel = 'Uninstall' ;
75
69
}
76
70
77
- const faEl = h . i ( { className : 'fa fa-spinner fa-pulse fa-fw' } ) ;
71
+ const faEl = h . i ( { className : 'fa fa-spinner fa-pulse fa-fw' } ) ;
78
72
const content = extension . busy ? faEl : btnLabel ;
79
73
80
74
buttonArr . push ( h . div ( {
@@ -107,4 +101,4 @@ export class ExtensionDetailWidget extends VirtualWidget {
107
101
return buttonArr ;
108
102
}
109
103
110
- }
104
+ }
0 commit comments