From 1f66bd269116208375ad052682c4faa49b475e6b Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 14 Jun 2024 14:22:18 +0800 Subject: [PATCH] Get nav into higher z-index, start to add the ADdLink control --- .../elements/icons/HighlightsIcon.tsx | 2 +- .../elements/icons/ShortcutFolderOpen.tsx | 2 +- .../components/templates/NavigationLayout.tsx | 44 ++++++++++++++++--- .../templates/navMenu/NavigationMenu.tsx | 2 +- 4 files changed, 40 insertions(+), 10 deletions(-) diff --git a/packages/web/components/elements/icons/HighlightsIcon.tsx b/packages/web/components/elements/icons/HighlightsIcon.tsx index 428786819..d89d03625 100644 --- a/packages/web/components/elements/icons/HighlightsIcon.tsx +++ b/packages/web/components/elements/icons/HighlightsIcon.tsx @@ -16,7 +16,7 @@ export class HighlightsIcon extends React.Component { fill="none" xmlns="http://www.w3.org/2000/svg" > - + { fill="none" xmlns="http://www.w3.org/2000/svg" > - + { + const result = await saveUrlMutation(link, timezone, locale) + if (result) { + showSuccessToastWithAction('Link saved', 'Read now', async () => { + window.location.href = `/article?url=${encodeURIComponent(link)}` + return Promise.resolve() + }) + // const id = result.url?.match(/[^/]+$/)?.[0] ?? '' + // performActionOnItem('refresh', undefined as unknown as any) + } else { + showErrorToast('Error saving link', { position: 'bottom-right' }) + } + }, + [] + ) + useEffect(() => { document.addEventListener('logout', showLogout) @@ -141,8 +166,7 @@ export function NavigationLayout(props: NavigationLayoutProps): JSX.Element { <> {}} + setShowAddLinkModal={setShowAddLinkModal} showMenu={showNavMenu} /> )} {props.children} - {showLogoutConfirmation ? ( + {showLogoutConfirmation && ( setShowLogoutConfirmation(false)} /> - ) : null} - {showKeyboardCommandsModal ? ( + )} + {showKeyboardCommandsModal && ( setShowKeyboardCommandsModal(false)} /> - ) : null} + )} + {showAddLinkModal && ( + + )} ) } @@ -183,7 +213,7 @@ const Header = (props: HeaderProps): JSX.Element => { alignment="start" distribution="center" css={{ - zIndex: 5, + zIndex: 10, position: props.menuOpen ? 'fixed' : 'absolute', left: '0px', top: '0px', diff --git a/packages/web/components/templates/navMenu/NavigationMenu.tsx b/packages/web/components/templates/navMenu/NavigationMenu.tsx index 794e235b4..eeef9c4c0 100644 --- a/packages/web/components/templates/navMenu/NavigationMenu.tsx +++ b/packages/web/components/templates/navMenu/NavigationMenu.tsx @@ -90,7 +90,7 @@ export function NavigationMenu(props: NavigationMenuProps): JSX.Element { boxShadow: 'rgb(48, 54, 61) 0px 0px 0px 1px, rgba(1, 4, 9, 0.4) 0px 6px 12px -3px, rgba(1, 4, 9, 0.4) 0px 6px 18px 0px', }, - zIndex: 2, + zIndex: 5, }} >