Skip to content

Commit

Permalink
refactor: asset paths (#189)
Browse files Browse the repository at this point in the history
* refactor: asset usage

Signed-off-by: Adam Setch <[email protected]>

* refactor: asset usage

Signed-off-by: Adam Setch <[email protected]>

* refactor: asset usage

Signed-off-by: Adam Setch <[email protected]>

---------

Signed-off-by: Adam Setch <[email protected]>
  • Loading branch information
setchy authored Oct 1, 2024
1 parent ba4f73b commit b96e0ff
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion config/webpack.config.renderer.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const configuration: webpack.Configuration = {
'dist',
'svg',
),
to: 'assets/twemoji',
to: 'images/twemoji',
},
],
}),
Expand Down
2 changes: 1 addition & 1 deletion src/main/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ export const idleAlternateIcon = getIconPath('tray-idle-white.png');
export const activeIcon = getIconPath('tray-active.png');

function getIconPath(iconName: string) {
return path.resolve(__dirname, '..', 'assets', 'images', iconName);
return path.join(__dirname, '..', 'assets', 'images', iconName);
}
4 changes: 2 additions & 2 deletions src/renderer/components/__snapshots__/AllRead.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/renderer/components/__snapshots__/Oops.test.tsx.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/renderer/components/primitives/EmojiText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const EmojiText: FC<IEmojiText> = ({ text }) => {
_options: TwemojiOptions,
_variant: string,
) => {
return path.join('assets', 'twemoji', `${icon}.svg`);
return path.join('images', 'twemoji', `${icon}.svg`);
},
});
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/renderer/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export const Constants = {

STORAGE_KEY: 'atlassify-storage',

NOTIFICATION_SOUND: 'notification.wav',

ALL_READ_EMOJIS: ['🎉', '🎊', '🥳', '👏', '🙌', '😎', '🏖️', '🚀', '✨', '🏆'],

FETCH_NOTIFICATIONS_INTERVAL: 60000,
Expand Down
9 changes: 8 additions & 1 deletion src/renderer/utils/notifications/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
AtlassifyState,
} from '../../types';
import { hideWindow, showWindow } from '../comms';
import { Constants } from '../constants';
import { formatNotificationFooterText } from '../helpers';
import { openNotification } from '../links';
import { isWindows } from '../platform';
Expand Down Expand Up @@ -88,7 +89,13 @@ export const raiseNativeNotification = (

export const raiseSoundNotification = () => {
const audio = new Audio(
path.resolve(__dirname, '..', 'assets', 'sounds', 'notification.wav'),
path.join(
__dirname,
'..',
'assets',
'sounds',
Constants.NOTIFICATION_SOUND,
),
);
audio.volume = 0.2;
audio.play();
Expand Down

0 comments on commit b96e0ff

Please sign in to comment.