Skip to content

Commit

Permalink
Merge pull request #82 from valory-xyz/mohan/update-icons
Browse files Browse the repository at this point in the history
fix: Tray and desktop icons
  • Loading branch information
mohandast52 authored May 14, 2024
2 parents 1f91773 + 6d1962e commit 756eb2a
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 44 deletions.
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const main = async () => {
token: process.env.GH_TOKEN,
},
category: 'public.app-category.utilities',
icon: 'electron/assets/icons/splash-robot-head.png',
icon: 'electron/assets/icons/splash-robot-head-dock.png',
hardenedRuntime: true,
gatekeeperAssess: false,
entitlements: 'electron/entitlements.mac.plist',
Expand Down
50 changes: 22 additions & 28 deletions electron/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
{
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
"extends": ["eslint:recommended", "plugin:prettier/recommended"],
"plugins": ["prettier"],
"ignorePatterns": [".next/"],
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto",
"semi": true,
"singleQuote": true
}
],
"plugins": [
"prettier"
],
"ignorePatterns": [
".next/"
],
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto",
"semi": true,
"singleQuote": true
}
]
},
"parserOptions": {
"ecmaVersion": "latest",
"commonjs": true
},
"env": {
"node": true,
"es6": true
}
}
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }]
},
"parserOptions": {
"ecmaVersion": "latest",
"commonjs": true
},
"env": {
"node": true,
"es6": true
}
}
Binary file added electron/assets/icons/splash-robot-head-dock.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified electron/assets/icons/splash-robot-head.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified electron/assets/icons/tray-logged-out.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified electron/assets/icons/tray-low-gas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified electron/assets/icons/tray-paused.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified electron/assets/icons/tray-running.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion electron/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const TRAY_ICONS = {
try {
if (process.platform === 'darwin') {
// resize icons for macOS
const size = { width: 16, height: 16 }
const size = { width: 16, height: 16 };
TRAY_ICONS.LOGGED_OUT = TRAY_ICONS.LOGGED_OUT.resize(size);
TRAY_ICONS.LOW_GAS = TRAY_ICONS.LOW_GAS.resize({ width: 16, height: 16 });
TRAY_ICONS.PAUSED = TRAY_ICONS.PAUSED.resize({ width: 16, height: 16 });
Expand Down
25 changes: 15 additions & 10 deletions electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,12 @@ async function beforeQuit() {
* Creates the tray
*/
const createTray = () => {
tray = new Tray(
isWindows || isMac ? TRAY_ICONS.LOGGED_OUT : TRAY_ICONS_PATHS.LOGGED_OUT,
);
const trayPath =
isWindows || isMac ? TRAY_ICONS.LOGGED_OUT : TRAY_ICONS_PATHS.LOGGED_OUT;
const trayIcon = trayPath.resize({ width: 16 });
trayIcon.setTemplateImage(true);
const tray = new Tray(trayIcon);

const contextMenu = Menu.buildFromTemplate([
{
label: 'Show app',
Expand Down Expand Up @@ -113,7 +116,7 @@ const createTray = () => {
mainWindow.show();
});

ipcMain.on('tray', (event, status) => {
ipcMain.on('tray', (_event, status) => {
switch (status) {
case 'low-gas':
tray.setImage(
Expand Down Expand Up @@ -216,7 +219,7 @@ async function launchDaemon() {
});
return data;
}
const check = new Promise(function (resolve, reject) {
const check = new Promise(function (resolve, _reject) {
operateDaemon = spawn(
OperateCmd,
[
Expand Down Expand Up @@ -246,7 +249,7 @@ async function launchDaemon() {
}

async function launchDaemonDev() {
const check = new Promise(function (resolve, reject) {
const check = new Promise(function (resolve, _reject) {
operateDaemon = spawn('poetry', [
'run',
'operate',
Expand Down Expand Up @@ -294,13 +297,13 @@ async function launchNextApp() {
server.listen(appConfig.ports.prod.next, (err) => {
if (err) throw err;
console.log(
`> Next server runinng on http://localhost:${appConfig.ports.prod.next}`,
`> Next server running on http://localhost:${appConfig.ports.prod.next}`,
);
});
}

async function launchNextAppDev() {
await new Promise(function (resolve, reject) {
await new Promise(function (resolve, _reject) {
process.env.NEXT_PUBLIC_BACKEND_PORT = appConfig.ports.dev.operate; // must set next env var to connect to backend
nextAppProcess = spawn(
'yarn',
Expand All @@ -317,7 +320,7 @@ async function launchNextAppDev() {
});
}

ipcMain.on('check', async function (event, argument) {
ipcMain.on('check', async function (event, _argument) {
try {
event.sender.send('response', 'Checking installation');
if (!isDev) {
Expand Down Expand Up @@ -406,7 +409,9 @@ ipcMain.on('check', async function (event, argument) {
// APP-SPECIFIC EVENTS
app.on('ready', async () => {
if (platform === 'darwin') {
app.dock?.setIcon(path.join(__dirname, 'assets/icons/tray-logged-out.png'));
app.dock?.setIcon(
path.join(__dirname, 'assets/icons/splash-robot-head-dock.png'),
);
}
createSplashWindow();
});
Expand Down
2 changes: 1 addition & 1 deletion frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"unused-imports/no-unused-imports": "error",
"no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
"no-console": ["error", { "allow": ["error"] }],
"no-unused-vars": "warn",
"prettier/prettier": ["error", {
"endOfLine": "auto",
"semi": true,
Expand Down
3 changes: 1 addition & 2 deletions frontend/components/Main/MainAddFunds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const MainAddFunds = () => {

return (
<>
<CustomizedCardSection vertical={false} border gap={12}>
<CustomizedCardSection border gap={12}>
<Button
type="default"
size="large"
Expand All @@ -59,7 +59,6 @@ export const MainAddFunds = () => {
</Button>

<Popover
title={null}
placement="topRight"
trigger={['hover', 'click']}
content={<Text>Ability to withdraw is coming soon</Text>}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/Main/MainGasBalance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const FineDot = styled(Dot)`
background-color: ${COLOR.GREEN_2};
`;
const LowDot = styled(Dot)`
background-color: ${COLOR.PURPLE};
background-color: ${COLOR.ORANGE};
`;

const BalanceStatus = () => {
Expand Down

0 comments on commit 756eb2a

Please sign in to comment.