Skip to content

A local-first personal finance app

[FIX] Update DesktopLinkedNotes so links stay inline (#6858)

Juulz38a72656df59
diff --git a/packages/desktop-client/src/notes/DesktopLinkedNotes.tsx b/packages/desktop-client/src/notes/DesktopLinkedNotes.tsx
index d12a721598..6463100770 100644
--- a/packages/desktop-client/src/notes/DesktopLinkedNotes.tsx
+++ b/packages/desktop-client/src/notes/DesktopLinkedNotes.tsx
@@ -1,12 +1,13 @@
+import type { MouseEvent } from 'react';
import { useTranslation } from 'react-i18next';
-import { Button } from '@actual-app/components/button';
import { theme } from '@actual-app/components/theme';
import { isElectron } from 'loot-core/shared/environment';
import { normalizeUrl } from './linkParser';
+import { Link } from '@desktop-client/components/common/Link';
import { addNotification } from '@desktop-client/notifications/notificationsSlice';
import { useDispatch } from '@desktop-client/redux';
@@ -17,13 +18,6 @@ type DesktopLinkedNotesProps = {
isFilePath: boolean;
};
-const linkStyles = {
- color: theme.pageTextLink,
- textDecoration: 'underline',
- background: 'transparent',
- padding: 0,
-};
-
export function DesktopLinkedNotes({
displayText,
url,
@@ -33,7 +27,10 @@ export function DesktopLinkedNotes({
const dispatch = useDispatch();
const { t } = useTranslation();
- const handleClick = async () => {
+ const handleClick = async (e: MouseEvent) => {
+ e.stopPropagation();
+ e.preventDefault();
+
if (isFilePath) {
if (isElectron()) {
// Open file in file manager
@@ -59,9 +56,20 @@ export function DesktopLinkedNotes({
return (
<>
- <Button variant="bare" style={linkStyles} onPress={handleClick}>
+ <Link
+ variant="text"
+ onClick={handleClick}
+ style={{
+ color: theme.pageTextLink,
+ textDecoration: 'underline',
+ cursor: 'pointer',
+ '&:hover': {
+ color: theme.pageTextLinkLight,
+ },
+ }}
+ >
{displayText}
- </Button>
+ </Link>
{separator}
</>
);
diff --git a/upcoming-release-notes/6858.md b/upcoming-release-notes/6858.md
new file mode 100644
index 0000000000..ef6993e888
--- /dev/null
+++ b/upcoming-release-notes/6858.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [Juulz]
+---
+
+Update DesktopLinkedNotes so links stay inline