add back sign out link on mobile

This commit is contained in:
Sean Yesmunt 2020-08-20 11:10:29 -04:00
parent 4ebb463508
commit 17feef93df

View file

@ -9,6 +9,37 @@ import NotificationBubble from 'component/notificationBubble';
const ESCAPE_KEY_CODE = 27; const ESCAPE_KEY_CODE = 27;
const BACKSLASH_KEY_CODE = 220; const BACKSLASH_KEY_CODE = 220;
type Props = {
subscriptions: Array<Subscription>,
email: ?string,
uploadCount: number,
doSignOut: () => void,
sidebarOpen: boolean,
setSidebarOpen: boolean => void,
isMediumScreen: boolean,
isOnFilePage: boolean,
unreadCount: number,
purchaseSuccess: boolean,
doClearPurchasedUriSuccess: () => void,
user: ?User,
};
function SideNavigation(props: Props) {
const {
subscriptions,
doSignOut,
email,
purchaseSuccess,
doClearPurchasedUriSuccess,
sidebarOpen,
setSidebarOpen,
isMediumScreen,
isOnFilePage,
unreadCount,
user,
} = props;
const TOP_LEVEL_LINKS: Array<{ const TOP_LEVEL_LINKS: Array<{
label: string, label: string,
navigate: string, navigate: string,
@ -47,7 +78,8 @@ const TOP_LEVEL_LINKS: Array<{
const ABSOLUTE_LINKS: Array<{ const ABSOLUTE_LINKS: Array<{
label: string, label: string,
navigate: string, navigate?: string,
onClick?: () => any,
icon: string, icon: string,
extra?: Node, extra?: Node,
hideForUnauth?: boolean, hideForUnauth?: boolean,
@ -119,6 +151,12 @@ const ABSOLUTE_LINKS: Array<{
icon: ICONS.HELP, icon: ICONS.HELP,
hideForUnauth: true, hideForUnauth: true,
}, },
{
label: 'Sign Out',
onClick: doSignOut,
icon: ICONS.SIGN_OUT,
hideForUnauth: true,
},
]; ];
const UNAUTH_LINKS: Array<{ const UNAUTH_LINKS: Array<{
@ -126,7 +164,6 @@ const UNAUTH_LINKS: Array<{
navigate: string, navigate: string,
icon: string, icon: string,
extra?: Node, extra?: Node,
hideForUnauth?: boolean,
}> = [ }> = [
{ {
label: 'Sign In', label: 'Sign In',
@ -150,35 +187,6 @@ const UNAUTH_LINKS: Array<{
}, },
]; ];
type Props = {
subscriptions: Array<Subscription>,
email: ?string,
uploadCount: number,
doSignOut: () => void,
sidebarOpen: boolean,
setSidebarOpen: boolean => void,
isMediumScreen: boolean,
isOnFilePage: boolean,
unreadCount: number,
purchaseSuccess: boolean,
doClearPurchasedUriSuccess: () => void,
user: ?User,
};
function SideNavigation(props: Props) {
const {
subscriptions,
// doSignOut,
email,
purchaseSuccess,
doClearPurchasedUriSuccess,
sidebarOpen,
setSidebarOpen,
isMediumScreen,
isOnFilePage,
unreadCount,
user,
} = props;
const notificationsEnabled = user && user.experimental_ui; const notificationsEnabled = user && user.experimental_ui;
const isAuthenticated = Boolean(email); const isAuthenticated = Boolean(email);
const [pulseLibrary, setPulseLibrary] = React.useState(false); const [pulseLibrary, setPulseLibrary] = React.useState(false);