diff --git a/webapp/channels/src/components/settings_sidebar/settings_sidebar.tsx b/webapp/channels/src/components/settings_sidebar/settings_sidebar.tsx index e794272a921..e48ffdf71e1 100644 --- a/webapp/channels/src/components/settings_sidebar/settings_sidebar.tsx +++ b/webapp/channels/src/components/settings_sidebar/settings_sidebar.tsx @@ -26,10 +26,12 @@ export type Props = { export default class SettingsSidebar extends React.PureComponent { buttonRefs: Array>; + totalTabs: Tab[]; constructor(props: Props) { super(props); - this.buttonRefs = this.props.tabs.map(() => React.createRef()); + this.totalTabs = [...this.props.tabs, ...this.props.pluginTabs || []]; + this.buttonRefs = this.totalTabs.map(() => React.createRef()); } public handleClick = (tab: Tab, e: React.MouseEvent) => { @@ -41,13 +43,19 @@ export default class SettingsSidebar extends React.PureComponent { public handleKeyUp = (index: number, e: React.KeyboardEvent) => { if (isKeyPressed(e, Constants.KeyCodes.UP)) { if (index > 0) { - this.props.updateTab(this.props.tabs[index - 1].name); + this.props.updateTab(this.totalTabs[index - 1].name); a11yFocus(this.buttonRefs[index - 1].current); + } else { + this.props.updateTab(this.totalTabs[this.totalTabs.length - 1].name); + a11yFocus(this.buttonRefs[this.buttonRefs.length - 1].current); } } else if (isKeyPressed(e, Constants.KeyCodes.DOWN)) { - if (index < this.props.tabs.length - 1) { - this.props.updateTab(this.props.tabs[index + 1].name); + if (index < this.totalTabs.length - 1) { + this.props.updateTab(this.totalTabs[index + 1].name); a11yFocus(this.buttonRefs[index + 1].current); + } else { + this.props.updateTab(this.totalTabs[0].name); + a11yFocus(this.buttonRefs[0].current); } } }; @@ -55,9 +63,9 @@ export default class SettingsSidebar extends React.PureComponent { private renderTab(tab: Tab, index: number) { const key = `${tab.name}_li`; const isActive = this.props.activeTab === tab.name; - let className = ''; + let className = 'nav-pills__tab'; if (isActive) { - className = 'active'; + className += ' active'; } let icon; @@ -79,27 +87,22 @@ export default class SettingsSidebar extends React.PureComponent { } return ( - + {icon} + {tab.uiName} + ); } @@ -110,32 +113,39 @@ export default class SettingsSidebar extends React.PureComponent { pluginTabList = ( <>
-
  • - -
  • - {this.props.pluginTabs.map((tab, index) => this.renderTab(tab, index))} +
    + +
    + {this.props.pluginTabs.map((tab, index) => this.renderTab(tab, index + this.props.tabs.length))} + ); } return ( -
    -
      +
      +
      {tabList} - {pluginTabList} -
    +
    + {pluginTabList} ); } diff --git a/webapp/channels/src/components/team_settings/team_access_tab/team_access_tab.tsx b/webapp/channels/src/components/team_settings/team_access_tab/team_access_tab.tsx index 1bc7d66bd01..bf04a6f5dce 100644 --- a/webapp/channels/src/components/team_settings/team_access_tab/team_access_tab.tsx +++ b/webapp/channels/src/components/team_settings/team_access_tab/team_access_tab.tsx @@ -123,7 +123,12 @@ const AccessTab = ({closeModal, collapseModal, hasChangeTabError, hasChanges, se {formatMessage({id: 'team_settings_modal.title', defaultMessage: 'Team Settings'})} -
    +
    {team.group_constrained ? undefined : {formatMessage({id: 'team_settings_modal.title', defaultMessage: 'Team Settings'})}
    -
    +
    +
    +
    { const pictureSection = this.createPictureSection(); return ( -
    +