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