Skip to content

Commit 756eb2a

Browse files
authored
Merge pull request #82 from valory-xyz/mohan/update-icons
fix: Tray and desktop icons
2 parents 1f91773 + 6d1962e commit 756eb2a

13 files changed

+42
-44
lines changed

build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const main = async () => {
3434
token: process.env.GH_TOKEN,
3535
},
3636
category: 'public.app-category.utilities',
37-
icon: 'electron/assets/icons/splash-robot-head.png',
37+
icon: 'electron/assets/icons/splash-robot-head-dock.png',
3838
hardenedRuntime: true,
3939
gatekeeperAssess: false,
4040
entitlements: 'electron/entitlements.mac.plist',

electron/.eslintrc.json

+22-28
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
11
{
2-
"extends": [
3-
"eslint:recommended",
4-
"plugin:prettier/recommended"
2+
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
3+
"plugins": ["prettier"],
4+
"ignorePatterns": [".next/"],
5+
"rules": {
6+
"prettier/prettier": [
7+
"error",
8+
{
9+
"endOfLine": "auto",
10+
"semi": true,
11+
"singleQuote": true
12+
}
513
],
6-
"plugins": [
7-
"prettier"
8-
],
9-
"ignorePatterns": [
10-
".next/"
11-
],
12-
"rules": {
13-
"prettier/prettier": [
14-
"error",
15-
{
16-
"endOfLine": "auto",
17-
"semi": true,
18-
"singleQuote": true
19-
}
20-
]
21-
},
22-
"parserOptions": {
23-
"ecmaVersion": "latest",
24-
"commonjs": true
25-
},
26-
"env": {
27-
"node": true,
28-
"es6": true
29-
}
30-
}
14+
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }]
15+
},
16+
"parserOptions": {
17+
"ecmaVersion": "latest",
18+
"commonjs": true
19+
},
20+
"env": {
21+
"node": true,
22+
"es6": true
23+
}
24+
}
31.8 KB
Loading
-13 Bytes
Loading
1.31 KB
Loading
2.81 KB
Loading

electron/assets/icons/tray-paused.png

2.66 KB
Loading
2.64 KB
Loading

electron/icons.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const TRAY_ICONS = {
1717
try {
1818
if (process.platform === 'darwin') {
1919
// resize icons for macOS
20-
const size = { width: 16, height: 16 }
20+
const size = { width: 16, height: 16 };
2121
TRAY_ICONS.LOGGED_OUT = TRAY_ICONS.LOGGED_OUT.resize(size);
2222
TRAY_ICONS.LOW_GAS = TRAY_ICONS.LOW_GAS.resize({ width: 16, height: 16 });
2323
TRAY_ICONS.PAUSED = TRAY_ICONS.PAUSED.resize({ width: 16, height: 16 });

electron/main.js

+15-10
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,12 @@ async function beforeQuit() {
8383
* Creates the tray
8484
*/
8585
const createTray = () => {
86-
tray = new Tray(
87-
isWindows || isMac ? TRAY_ICONS.LOGGED_OUT : TRAY_ICONS_PATHS.LOGGED_OUT,
88-
);
86+
const trayPath =
87+
isWindows || isMac ? TRAY_ICONS.LOGGED_OUT : TRAY_ICONS_PATHS.LOGGED_OUT;
88+
const trayIcon = trayPath.resize({ width: 16 });
89+
trayIcon.setTemplateImage(true);
90+
const tray = new Tray(trayIcon);
91+
8992
const contextMenu = Menu.buildFromTemplate([
9093
{
9194
label: 'Show app',
@@ -113,7 +116,7 @@ const createTray = () => {
113116
mainWindow.show();
114117
});
115118

116-
ipcMain.on('tray', (event, status) => {
119+
ipcMain.on('tray', (_event, status) => {
117120
switch (status) {
118121
case 'low-gas':
119122
tray.setImage(
@@ -216,7 +219,7 @@ async function launchDaemon() {
216219
});
217220
return data;
218221
}
219-
const check = new Promise(function (resolve, reject) {
222+
const check = new Promise(function (resolve, _reject) {
220223
operateDaemon = spawn(
221224
OperateCmd,
222225
[
@@ -246,7 +249,7 @@ async function launchDaemon() {
246249
}
247250

248251
async function launchDaemonDev() {
249-
const check = new Promise(function (resolve, reject) {
252+
const check = new Promise(function (resolve, _reject) {
250253
operateDaemon = spawn('poetry', [
251254
'run',
252255
'operate',
@@ -294,13 +297,13 @@ async function launchNextApp() {
294297
server.listen(appConfig.ports.prod.next, (err) => {
295298
if (err) throw err;
296299
console.log(
297-
`> Next server runinng on http://localhost:${appConfig.ports.prod.next}`,
300+
`> Next server running on http://localhost:${appConfig.ports.prod.next}`,
298301
);
299302
});
300303
}
301304

302305
async function launchNextAppDev() {
303-
await new Promise(function (resolve, reject) {
306+
await new Promise(function (resolve, _reject) {
304307
process.env.NEXT_PUBLIC_BACKEND_PORT = appConfig.ports.dev.operate; // must set next env var to connect to backend
305308
nextAppProcess = spawn(
306309
'yarn',
@@ -317,7 +320,7 @@ async function launchNextAppDev() {
317320
});
318321
}
319322

320-
ipcMain.on('check', async function (event, argument) {
323+
ipcMain.on('check', async function (event, _argument) {
321324
try {
322325
event.sender.send('response', 'Checking installation');
323326
if (!isDev) {
@@ -406,7 +409,9 @@ ipcMain.on('check', async function (event, argument) {
406409
// APP-SPECIFIC EVENTS
407410
app.on('ready', async () => {
408411
if (platform === 'darwin') {
409-
app.dock?.setIcon(path.join(__dirname, 'assets/icons/tray-logged-out.png'));
412+
app.dock?.setIcon(
413+
path.join(__dirname, 'assets/icons/splash-robot-head-dock.png'),
414+
);
410415
}
411416
createSplashWindow();
412417
});

frontend/.eslintrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"simple-import-sort/imports": "error",
2525
"simple-import-sort/exports": "error",
2626
"unused-imports/no-unused-imports": "error",
27+
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
2728
"no-console": ["error", { "allow": ["error"] }],
28-
"no-unused-vars": "warn",
2929
"prettier/prettier": ["error", {
3030
"endOfLine": "auto",
3131
"semi": true,

frontend/components/Main/MainAddFunds.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const MainAddFunds = () => {
4949

5050
return (
5151
<>
52-
<CustomizedCardSection vertical={false} border gap={12}>
52+
<CustomizedCardSection border gap={12}>
5353
<Button
5454
type="default"
5555
size="large"
@@ -59,7 +59,6 @@ export const MainAddFunds = () => {
5959
</Button>
6060

6161
<Popover
62-
title={null}
6362
placement="topRight"
6463
trigger={['hover', 'click']}
6564
content={<Text>Ability to withdraw is coming soon</Text>}

frontend/components/Main/MainGasBalance.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const FineDot = styled(Dot)`
2929
background-color: ${COLOR.GREEN_2};
3030
`;
3131
const LowDot = styled(Dot)`
32-
background-color: ${COLOR.PURPLE};
32+
background-color: ${COLOR.ORANGE};
3333
`;
3434

3535
const BalanceStatus = () => {

0 commit comments

Comments
 (0)