welcome: hide tabs if nothing to show
This commit is contained in:
parent
4a21882345
commit
9fdc18d1ec
|
@ -7,6 +7,7 @@ import type { Dispatch } from 'redux';
|
|||
import { createWelcomePageEvent, sendAnalytics } from '../../analytics';
|
||||
import { appNavigate } from '../../app';
|
||||
import { isCalendarEnabled } from '../../calendar-sync';
|
||||
import { isRecentListEnabled } from '../../recent-list/functions';
|
||||
|
||||
/**
|
||||
* {@code AbstractWelcomePage}'s React {@code Component} prop types.
|
||||
|
@ -18,6 +19,11 @@ type Props = {
|
|||
*/
|
||||
_calendarEnabled: boolean,
|
||||
|
||||
/**
|
||||
* Whether the recent list is enabled
|
||||
*/
|
||||
_recentListEnabled: Boolean,
|
||||
|
||||
/**
|
||||
* Room name to join to.
|
||||
*/
|
||||
|
@ -239,6 +245,7 @@ export class AbstractWelcomePage extends Component<Props, *> {
|
|||
export function _mapStateToProps(state: Object) {
|
||||
return {
|
||||
_calendarEnabled: isCalendarEnabled(state),
|
||||
_recentListEnabled: isRecentListEnabled(),
|
||||
_room: state['features/base/conference'].room,
|
||||
_settings: state['features/base/settings']
|
||||
};
|
||||
|
|
|
@ -285,7 +285,7 @@ class WelcomePage extends AbstractWelcomePage {
|
|||
return null;
|
||||
}
|
||||
|
||||
const { _calendarEnabled, t } = this.props;
|
||||
const { _calendarEnabled, _recentListEnabled, t } = this.props;
|
||||
|
||||
const tabs = [];
|
||||
|
||||
|
@ -296,10 +296,16 @@ class WelcomePage extends AbstractWelcomePage {
|
|||
});
|
||||
}
|
||||
|
||||
tabs.push({
|
||||
label: t('welcomepage.recentList'),
|
||||
content: <RecentList />
|
||||
});
|
||||
if (_recentListEnabled) {
|
||||
tabs.push({
|
||||
label: t('welcomepage.recentList'),
|
||||
content: <RecentList />
|
||||
});
|
||||
}
|
||||
|
||||
if (tabs.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Tabs
|
||||
|
|
Loading…
Reference in New Issue