Skip to content

Commit 4d1a241

Browse files
committed
refactor: shared app name
Signed-off-by: Adam Setch <[email protected]>
1 parent 6eb1bae commit 4d1a241

File tree

12 files changed

+48
-27
lines changed

12 files changed

+48
-27
lines changed

src/main/menu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default class MenuBuilder {
7979
click: () => openLogsDirectory(),
8080
},
8181
{
82-
label: 'Reset App',
82+
label: `Reset ${APPLICATION.NAME}`,
8383
click: () => {
8484
resetApp(this.menubar);
8585
},
@@ -88,7 +88,7 @@ export default class MenuBuilder {
8888
},
8989
{ type: 'separator' },
9090
{
91-
label: 'Quit Gitify',
91+
label: `Quit ${APPLICATION.NAME}`,
9292
accelerator: 'CommandOrControl+Q',
9393
click: () => {
9494
this.menubar.app.quit();

src/main/utils.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ import { dialog, shell } from 'electron';
55
import log from 'electron-log';
66
import type { Menubar } from 'menubar';
77

8+
import { APPLICATION } from '../shared/constants';
89
import { namespacedEvent } from '../shared/events';
910
import { logError, logInfo } from '../shared/logger';
1011

1112
export function takeScreenshot(mb: Menubar) {
1213
const date = new Date();
1314
const dateStr = date.toISOString().replace(/:/g, '-');
1415

15-
const capturedPicFilePath = `${os.homedir()}/${dateStr}-gitify-screenshot.png`;
16+
const capturedPicFilePath = path.join(
17+
os.homedir(),
18+
`${dateStr}-${APPLICATION.NAME}-screenshot.png`,
19+
);
1620
mb.window.capturePage().then((img) => {
1721
fs.writeFile(capturedPicFilePath, img.toPNG(), () =>
1822
logInfo('takeScreenshot', `Screenshot saved ${capturedPicFilePath}`),
@@ -26,9 +30,8 @@ export function resetApp(mb: Menubar) {
2630

2731
const response = dialog.showMessageBoxSync(mb.window, {
2832
type: 'warning',
29-
title: 'Reset Gitify',
30-
message:
31-
'Are you sure you want to reset Gitify? You will be logged out of all accounts',
33+
title: `Reset ${APPLICATION.NAME}`,
34+
message: `Are you sure you want to reset ${APPLICATION.NAME}? You will be logged out of all accounts`,
3235
buttons: ['Cancel', 'Reset'],
3336
defaultId: cancelButtonId,
3437
cancelId: cancelButtonId,

src/renderer/components/Sidebar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from '@primer/octicons-react';
1010
import { type FC, useContext, useMemo } from 'react';
1111
import { useLocation, useNavigate } from 'react-router-dom';
12+
import { APPLICATION } from '../../shared/constants';
1213
import { AppContext } from '../context/App';
1314
import { Size } from '../types';
1415
import { quitApp } from '../utils/comms';
@@ -79,7 +80,7 @@ export const Sidebar: FC = () => {
7980
title="Home"
8081
onClick={() => navigate('/', { replace: true })}
8182
>
82-
<LogoIcon size={Size.SMALL} aria-label="Open Gitify" />
83+
<LogoIcon size={Size.SMALL} aria-label={`Open ${APPLICATION.NAME}`} />
8384
</button>
8485

8586
<SidebarButton
@@ -133,7 +134,7 @@ export const Sidebar: FC = () => {
133134

134135
{!isLoggedIn && (
135136
<SidebarButton
136-
title="Quit Gitify"
137+
title={`Quit ${APPLICATION.NAME}`}
137138
icon={XCircleIcon}
138139
size={Size.MEDIUM}
139140
onClick={() => quitApp()}

src/renderer/components/icons/LogoIcon.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { FC } from 'react';
2+
import { APPLICATION } from '../../../shared/constants';
23
import { Size } from '../../types';
34
import { cn } from '../../utils/cn';
45

@@ -31,7 +32,7 @@ export const LogoIcon: FC<ILogoIcon> = ({
3132
xmlnsXlink="https://www.w3.org/1999/xlink"
3233
viewBox="0 0 500 500"
3334
role="img"
34-
aria-label="Gitify Logo"
35+
aria-label={`${APPLICATION.NAME} Logo`}
3536
{...props}
3637
>
3738
<defs>

src/renderer/components/settings/NotificationSettings.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { BellIcon } from '@primer/octicons-react';
22
import { type FC, type MouseEvent, useContext } from 'react';
3+
import { APPLICATION } from '../../../shared/constants';
34
import { AppContext } from '../../context/App';
45
import { GroupBy } from '../../types';
56
import { openGitHubParticipatingDocs } from '../../utils/links';
@@ -106,9 +107,9 @@ export const NotificationSettings: FC = () => {
106107
}
107108
tooltip={
108109
<div>
109-
Keep the notification within Gitify window upon interaction (click,
110-
mark as read, mark as done, etc) until the next refresh window
111-
(scheduled or user initiated).
110+
Keep the notification within {APPLICATION.NAME} upon interaction
111+
(ie: open notification, mark as read, mark as done) until the next
112+
refresh window (scheduled or user initiated).
112113
</div>
113114
}
114115
/>

src/renderer/components/settings/SettingsFooter.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ describe('renderer/routes/components/settings/SettingsFooter.tsx', () => {
9898
);
9999
});
100100

101-
fireEvent.click(screen.getByTitle('View release notes'));
101+
fireEvent.click(screen.getByTitle('View Gitify release notes'));
102102

103103
expect(openExternalLinkMock).toHaveBeenCalledTimes(1);
104104
expect(openExternalLinkMock).toHaveBeenCalledWith(

src/renderer/components/settings/SettingsFooter.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { PersonIcon, XCircleIcon } from '@primer/octicons-react';
22
import { type FC, useEffect, useState } from 'react';
33
import { useNavigate } from 'react-router-dom';
4+
import { APPLICATION } from '../../../shared/constants';
45
import { BUTTON_CLASS_NAME } from '../../styles/gitify';
56
import { Size } from '../../types';
67
import { getAppVersion, quitApp } from '../../utils/comms';
@@ -26,11 +27,13 @@ export const SettingsFooter: FC = () => {
2627
<button
2728
type="button"
2829
className="cursor-pointer font-semibold"
29-
title="View release notes"
30+
title={`View ${APPLICATION.NAME} release notes`}
3031
onClick={() => openGitifyReleaseNotes(appVersion)}
3132
>
3233
<div className="flex items-center gap-1">
33-
<span aria-label="app-version">Gitify {appVersion}</span>
34+
<span aria-label="app-version">
35+
{APPLICATION.NAME} {appVersion}
36+
</span>
3437
</div>
3538
</button>
3639
<div>
@@ -48,10 +51,13 @@ export const SettingsFooter: FC = () => {
4851
<button
4952
type="button"
5053
className={BUTTON_CLASS_NAME}
51-
title="Quit Gitify"
54+
title={`Quit ${APPLICATION.NAME}`}
5255
onClick={quitApp}
5356
>
54-
<XCircleIcon size={Size.LARGE} aria-label="Quit Gitify" />
57+
<XCircleIcon
58+
size={Size.LARGE}
59+
aria-label={`Quit ${APPLICATION.NAME}`}
60+
/>
5561
</button>
5662
</div>
5763
</div>

src/renderer/components/settings/SystemSettings.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { DeviceDesktopIcon } from '@primer/octicons-react';
22
import { type FC, useContext } from 'react';
3+
import { APPLICATION } from '../../../shared/constants';
34
import { isLinux, isMacOS } from '../../../shared/platform';
45
import { AppContext } from '../../context/App';
56
import { OpenPreference } from '../../types';
@@ -39,7 +40,7 @@ export const SystemSettings: FC = () => {
3940
<span className="text-orange-600">
4041
{Constants.DEFAULT_KEYBOARD_SHORTCUT}
4142
</span>{' '}
42-
to show or hide Gitify.
43+
to show or hide {APPLICATION.NAME}.
4344
</div>
4445
}
4546
/>
@@ -77,8 +78,8 @@ export const SystemSettings: FC = () => {
7778
tooltip={
7879
<div>
7980
<div className="pb-3">
80-
Use a white Gitify logo (instead of the default black logo) when
81-
all notifications are read.
81+
Use a white {APPLICATION.NAME} logo (instead of the default black
82+
logo) when all notifications are read.
8283
</div>
8384
<div>
8485
This is particularly useful for devices which have a dark-themed

src/renderer/components/settings/__snapshots__/SettingsFooter.test.tsx.snap

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/routes/__snapshots__/Settings.test.tsx.snap

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)