@@ -9,15 +9,15 @@ type PreferenceNavigationProperties = {
99} ;
1010
1111export default class PreferenceNavigation {
12- navigationItems : NavigationItem [ ] ;
12+ navigationItems : Array < { navigationItem : NavigationItem ; label : string } > ;
1313 $el : Element ;
1414 constructor ( private readonly properties : PreferenceNavigationProperties ) {
1515 this . navigationItems = [
16- "General" ,
17- "Network" ,
18- "AddServer" ,
19- "Organizations" ,
20- "Shortcuts" ,
16+ { navigationItem : "General" , label : t . __ ( "General" ) } ,
17+ { navigationItem : "Network" , label : t . __ ( "Network" ) } ,
18+ { navigationItem : "AddServer" , label : t . __ ( "Add Organization" ) } ,
19+ { navigationItem : "Organizations" , label : t . __ ( "Organizations" ) } ,
20+ { navigationItem : "Shortcuts" , label : t . __ ( "Shortcuts" ) } ,
2121 ] ;
2222
2323 this . $el = generateNodeFromHtml ( this . templateHtml ( ) ) ;
@@ -28,11 +28,8 @@ export default class PreferenceNavigation {
2828 templateHtml ( ) : Html {
2929 const navigationItemsHtml = html `` . join (
3030 this . navigationItems . map (
31- ( navigationItem ) => html `
32- < div class ="nav " id ="nav- ${ navigationItem } ">
33- ${ t . __ ( navigationItem ) }
34- </ div >
35- ` ,
31+ ( { navigationItem, label} ) =>
32+ html `< div class ="nav " id ="nav- ${ navigationItem } "> ${ label } </ div > ` ,
3633 ) ,
3734 ) ;
3835
@@ -45,7 +42,7 @@ export default class PreferenceNavigation {
4542 }
4643
4744 registerListeners ( ) : void {
48- for ( const navigationItem of this . navigationItems ) {
45+ for ( const { navigationItem} of this . navigationItems ) {
4946 const $item = this . $el . querySelector (
5047 `#nav-${ CSS . escape ( navigationItem ) } ` ,
5148 ) ! ;
@@ -56,7 +53,7 @@ export default class PreferenceNavigation {
5653 }
5754
5855 select ( navigationItemToSelect : NavigationItem ) : void {
59- for ( const navigationItem of this . navigationItems ) {
56+ for ( const { navigationItem} of this . navigationItems ) {
6057 if ( navigationItem === navigationItemToSelect ) {
6158 this . activate ( navigationItem ) ;
6259 } else {
0 commit comments