@@ -40,14 +40,16 @@ import { NonEmptyArray } from "../../../@types/common";
4040import { PollHistoryTab } from "../settings/tabs/room/PollHistoryTab" ;
4141import ErrorBoundary from "../elements/ErrorBoundary" ;
4242
43- export const ROOM_GENERAL_TAB = "ROOM_GENERAL_TAB" ;
44- export const ROOM_VOIP_TAB = "ROOM_VOIP_TAB" ;
45- export const ROOM_SECURITY_TAB = "ROOM_SECURITY_TAB" ;
46- export const ROOM_ROLES_TAB = "ROOM_ROLES_TAB" ;
47- export const ROOM_NOTIFICATIONS_TAB = "ROOM_NOTIFICATIONS_TAB" ;
48- export const ROOM_BRIDGES_TAB = "ROOM_BRIDGES_TAB" ;
49- export const ROOM_ADVANCED_TAB = "ROOM_ADVANCED_TAB" ;
50- export const ROOM_POLL_HISTORY_TAB = "ROOM_POLL_HISTORY_TAB" ;
43+ export const enum RoomSettingsTab {
44+ General = "ROOM_GENERAL_TAB" ,
45+ Voip = "ROOM_VOIP_TAB" ,
46+ Security = "ROOM_SECURITY_TAB" ,
47+ Roles = "ROOM_ROLES_TAB" ,
48+ Notifications = "ROOM_NOTIFICATIONS_TAB" ,
49+ Bridges = "ROOM_BRIDGES_TAB" ,
50+ Advanced = "ROOM_ADVANCED_TAB" ,
51+ PollHistory = "ROOM_POLL_HISTORY_TAB" ,
52+ }
5153
5254interface IProps {
5355 roomId : string ;
@@ -118,12 +120,12 @@ class RoomSettingsDialog extends React.Component<IProps, IState> {
118120 this . forceUpdate ( ) ;
119121 } ;
120122
121- private getTabs ( ) : NonEmptyArray < Tab > {
122- const tabs : Tab [ ] = [ ] ;
123+ private getTabs ( ) : NonEmptyArray < Tab < RoomSettingsTab > > {
124+ const tabs : Tab < RoomSettingsTab > [ ] = [ ] ;
123125
124126 tabs . push (
125127 new Tab (
126- ROOM_GENERAL_TAB ,
128+ RoomSettingsTab . General ,
127129 _td ( "General" ) ,
128130 "mx_RoomSettingsDialog_settingsIcon" ,
129131 < GeneralRoomSettingsTab room = { this . state . room } /> ,
@@ -133,7 +135,7 @@ class RoomSettingsDialog extends React.Component<IProps, IState> {
133135 if ( SettingsStore . getValue ( "feature_group_calls" ) ) {
134136 tabs . push (
135137 new Tab (
136- ROOM_VOIP_TAB ,
138+ RoomSettingsTab . Voip ,
137139 _td ( "Voice & Video" ) ,
138140 "mx_RoomSettingsDialog_voiceIcon" ,
139141 < VoipRoomSettingsTab room = { this . state . room } /> ,
@@ -142,7 +144,7 @@ class RoomSettingsDialog extends React.Component<IProps, IState> {
142144 }
143145 tabs . push (
144146 new Tab (
145- ROOM_SECURITY_TAB ,
147+ RoomSettingsTab . Security ,
146148 _td ( "Security & Privacy" ) ,
147149 "mx_RoomSettingsDialog_securityIcon" ,
148150 < SecurityRoomSettingsTab room = { this . state . room } closeSettingsFn = { ( ) => this . props . onFinished ( true ) } /> ,
@@ -151,7 +153,7 @@ class RoomSettingsDialog extends React.Component<IProps, IState> {
151153 ) ;
152154 tabs . push (
153155 new Tab (
154- ROOM_ROLES_TAB ,
156+ RoomSettingsTab . Roles ,
155157 _td ( "Roles & Permissions" ) ,
156158 "mx_RoomSettingsDialog_rolesIcon" ,
157159 < RolesRoomSettingsTab room = { this . state . room } /> ,
@@ -160,7 +162,7 @@ class RoomSettingsDialog extends React.Component<IProps, IState> {
160162 ) ;
161163 tabs . push (
162164 new Tab (
163- ROOM_NOTIFICATIONS_TAB ,
165+ RoomSettingsTab . Notifications ,
164166 _td ( "Notifications" ) ,
165167 "mx_RoomSettingsDialog_notificationsIcon" ,
166168 (
@@ -176,7 +178,7 @@ class RoomSettingsDialog extends React.Component<IProps, IState> {
176178 if ( SettingsStore . getValue ( "feature_bridge_state" ) ) {
177179 tabs . push (
178180 new Tab (
179- ROOM_BRIDGES_TAB ,
181+ RoomSettingsTab . Bridges ,
180182 _td ( "Bridges" ) ,
181183 "mx_RoomSettingsDialog_bridgesIcon" ,
182184 < BridgeSettingsTab room = { this . state . room } /> ,
@@ -187,7 +189,7 @@ class RoomSettingsDialog extends React.Component<IProps, IState> {
187189
188190 tabs . push (
189191 new Tab (
190- ROOM_POLL_HISTORY_TAB ,
192+ RoomSettingsTab . PollHistory ,
191193 _td ( "Poll history" ) ,
192194 "mx_RoomSettingsDialog_pollsIcon" ,
193195 < PollHistoryTab room = { this . state . room } onFinished = { ( ) => this . props . onFinished ( true ) } /> ,
@@ -197,7 +199,7 @@ class RoomSettingsDialog extends React.Component<IProps, IState> {
197199 if ( SettingsStore . getValue ( UIFeature . AdvancedSettings ) ) {
198200 tabs . push (
199201 new Tab (
200- ROOM_ADVANCED_TAB ,
202+ RoomSettingsTab . Advanced ,
201203 _td ( "Advanced" ) ,
202204 "mx_RoomSettingsDialog_warningIcon" ,
203205 (
@@ -211,7 +213,7 @@ class RoomSettingsDialog extends React.Component<IProps, IState> {
211213 ) ;
212214 }
213215
214- return tabs as NonEmptyArray < Tab > ;
216+ return tabs as NonEmptyArray < Tab < RoomSettingsTab > > ;
215217 }
216218
217219 public render ( ) : React . ReactNode {
0 commit comments