From 92fbe4a537fcde551856e4efd8cb7832bfcd2892 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Mon, 25 Mar 2024 16:53:48 -0400 Subject: [PATCH 1/2] feat: link version number to release notes --- src/routes/Settings.tsx | 17 ++++++++++++++--- src/routes/__snapshots__/Settings.test.tsx.snap | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/routes/Settings.tsx b/src/routes/Settings.tsx index 6c3c77b31..c811940ea 100644 --- a/src/routes/Settings.tsx +++ b/src/routes/Settings.tsx @@ -20,7 +20,7 @@ import { AppContext } from '../context/App'; import { Appearance } from '../types'; import { apiRequestAuth } from '../utils/api-requests'; import { setAppearance } from '../utils/appearance'; -import { updateTrayIcon } from '../utils/comms'; +import { openExternalLink, updateTrayIcon } from '../utils/comms'; import Constants from '../utils/constants'; import { generateGitHubAPIUrl } from '../utils/helpers'; @@ -32,6 +32,12 @@ export const SettingsRoute: React.FC = () => { const [appVersion, setAppVersion] = useState(null); const [colorScope, setColorScope] = useState(false); + const openGitHubReleaseNotes = useCallback((version) => { + openExternalLink( + `https://github.com/${Constants.REPO_SLUG}/releases/tag/v${version}`, + ); + }, []); + useEffect(() => { ipcRenderer.invoke('get-platform').then((result: string) => { setIsLinux(result === 'linux'); @@ -166,8 +172,13 @@ export const SettingsRoute: React.FC = () => {
- Gitify v{appVersion} - + openGitHubReleaseNotes(appVersion)} + > + Gitify v{appVersion} +