From 1f66bd269116208375ad052682c4faa49b475e6b Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 14 Jun 2024 14:22:18 +0800 Subject: [PATCH 1/2] 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, }} > From 16d57f24960630bf17906521fc60900bcc6f23fc Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 14 Jun 2024 14:32:22 +0800 Subject: [PATCH 2/2] better dropdown handling on the main menu --- packages/web/components/elements/DropdownElements.tsx | 7 +++---- packages/web/components/templates/PrimaryDropdown.tsx | 7 ++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/web/components/elements/DropdownElements.tsx b/packages/web/components/elements/DropdownElements.tsx index a9657642e..2c6400684 100644 --- a/packages/web/components/elements/DropdownElements.tsx +++ b/packages/web/components/elements/DropdownElements.tsx @@ -16,13 +16,12 @@ const StyledItem = styled(Item, { fontWeight: '400', py: '10px', px: '15px', - borderRadius: 3, cursor: 'default', color: '$utilityTextDefault', '&:focus': { outline: 'none', - backgroundColor: '$grayBgHover', + backgroundColor: '$thLeftMenuBackground', }, }) @@ -32,7 +31,7 @@ const DropdownTrigger = styled(Trigger, { padding: 0, backgroundColor: 'transparent', '&:hover': { - opacity: 0.7, + opacity: 1.0, }, '&:focus': { outline: 'none', @@ -129,7 +128,7 @@ type DropdownProps = { export const DropdownSeparator = styled(Separator, { height: '1px', margin: 0, - backgroundColor: '$grayBorder', + backgroundColor: '$homeDivider', }) type DropdownOptionProps = { diff --git a/packages/web/components/templates/PrimaryDropdown.tsx b/packages/web/components/templates/PrimaryDropdown.tsx index 2785f8a57..659df484f 100644 --- a/packages/web/components/templates/PrimaryDropdown.tsx +++ b/packages/web/components/templates/PrimaryDropdown.tsx @@ -53,9 +53,10 @@ const TriggerButton = (props: TriggerButtonProps): JSX.Element => { alignItems: 'center', borderRadius: '5px', height: '32px', - padding: '5px', + px: '10px', + py: '20px', '&:hover': { - bg: '$thLibraryMenuFooterHover', + bg: '$thLeftMenuBackground', opacity: '0.7px', }, }} @@ -130,7 +131,7 @@ export function PrimaryDropdown(props: PrimaryDropdownProps): JSX.Element { triggerElement={ props.children ?? } - css={{ width: '240px', ml: '15px' }} + css={{ width: '240px', ml: '15px', bg: '$thNavMenuFooter' }} >