add back sign out link on mobile
This commit is contained in:
parent
4ebb463508
commit
17feef93df
1 changed files with 149 additions and 141 deletions
|
@ -9,13 +9,44 @@ import NotificationBubble from 'component/notificationBubble';
|
|||
|
||||
const ESCAPE_KEY_CODE = 27;
|
||||
const BACKSLASH_KEY_CODE = 220;
|
||||
const TOP_LEVEL_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 TOP_LEVEL_LINKS: Array<{
|
||||
label: string,
|
||||
navigate: string,
|
||||
icon: string,
|
||||
extra?: Node,
|
||||
hideForUnauth?: boolean,
|
||||
}> = [
|
||||
}> = [
|
||||
{
|
||||
label: 'Home',
|
||||
navigate: `/`,
|
||||
|
@ -43,15 +74,16 @@ const TOP_LEVEL_LINKS: Array<{
|
|||
icon: ICONS.PURCHASED,
|
||||
hideForUnauth: true,
|
||||
},
|
||||
];
|
||||
];
|
||||
|
||||
const ABSOLUTE_LINKS: Array<{
|
||||
const ABSOLUTE_LINKS: Array<{
|
||||
label: string,
|
||||
navigate: string,
|
||||
navigate?: string,
|
||||
onClick?: () => any,
|
||||
icon: string,
|
||||
extra?: Node,
|
||||
hideForUnauth?: boolean,
|
||||
}> = [
|
||||
}> = [
|
||||
{
|
||||
label: 'Upload',
|
||||
navigate: `/$/${PAGES.UPLOAD}`,
|
||||
|
@ -119,15 +151,20 @@ const ABSOLUTE_LINKS: Array<{
|
|||
icon: ICONS.HELP,
|
||||
hideForUnauth: true,
|
||||
},
|
||||
];
|
||||
{
|
||||
label: 'Sign Out',
|
||||
onClick: doSignOut,
|
||||
icon: ICONS.SIGN_OUT,
|
||||
hideForUnauth: true,
|
||||
},
|
||||
];
|
||||
|
||||
const UNAUTH_LINKS: Array<{
|
||||
const UNAUTH_LINKS: Array<{
|
||||
label: string,
|
||||
navigate: string,
|
||||
icon: string,
|
||||
extra?: Node,
|
||||
hideForUnauth?: boolean,
|
||||
}> = [
|
||||
}> = [
|
||||
{
|
||||
label: 'Sign In',
|
||||
navigate: `/$/${PAGES.AUTH_SIGNIN}`,
|
||||
|
@ -148,37 +185,8 @@ const UNAUTH_LINKS: Array<{
|
|||
navigate: `/$/${PAGES.HELP}`,
|
||||
icon: ICONS.HELP,
|
||||
},
|
||||
];
|
||||
];
|
||||
|
||||
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 isAuthenticated = Boolean(email);
|
||||
const [pulseLibrary, setPulseLibrary] = React.useState(false);
|
||||
|
|
Loading…
Add table
Reference in a new issue