Skip to content

Commit

Permalink
📦👌icons added
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgaerdonmez committed Jul 13, 2020
1 parent 67a2b2f commit 2456d86
Show file tree
Hide file tree
Showing 19 changed files with 78 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,6 @@ yarn-error.log*
yarn.lock

### for a while
assets/
assets/example
*.old.*
sound_old
Binary file added assets/Icon.icns
Binary file not shown.
68 changes: 68 additions & 0 deletions assets/Icon.iconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "1x",
"filename" : "icon_16@1x.png"
},
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "2x",
"filename" : "icon_16@2x.png"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "1x",
"filename" : "icon_32@1x.png"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "2x",
"filename" : "icon_32@2x.png"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "1x",
"filename" : "icon_128@1x.png"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "2x",
"filename" : "icon_128@2x.png"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "1x",
"filename" : "icon_256@1x.png"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "2x",
"filename" : "icon_256@2x.png"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x",
"filename" : "icon_512@1x.png"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x",
"filename" : "icon_512@2x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added assets/Icon.iconset/icon_128@1x.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 added assets/Icon.iconset/icon_128@2x.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 added assets/Icon.iconset/icon_16@1x.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 added assets/Icon.iconset/icon_16@2x.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 added assets/Icon.iconset/icon_256@1x.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 added assets/Icon.iconset/icon_256@2x.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 added assets/Icon.iconset/icon_32@1x.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 added assets/Icon.iconset/icon_32@2x.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 added assets/Icon.iconset/icon_512@1x.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 added assets/Icon.iconset/icon_512@2x.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/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function createMainWindow() {
preload: path.join(__dirname, "preload.js"),
backgroundThrottling: false,
},
icon: path.join(__dirname, "assets/icons/png/1204x1024.png"),
icon: path.join(__dirname, "assets/icons/Icon.icns"),
});

mainWindow.on("close", () => {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "metronome",
"productName": "Metronome",
"version": "0.1.0",
"private": true,
"main": "electron/main.js",
Expand Down Expand Up @@ -57,7 +58,7 @@
"prepackage-win": "yarn prepackage"
},
"build": {
"appId": "com.example.electron-cra",
"appId": "com.tolgaerdonmez.metronome",
"files": [
"build/**/*",
"node_modules/**/*"
Expand Down
4 changes: 2 additions & 2 deletions src/components/Metronome/PresetSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import { ReactComponent as LeftArrowIcon } from "../../icons/arrowLeft.svg";

function PresetSelector(): ReactElement {
const dispatch = useDispatch();
const { preset } = useSelector((state: ReduxState) => ({
const { preset, playing } = useSelector((state: ReduxState) => ({
...state.metronome,
}));

const changePreset = (direction: number) => {
const p = preset + direction;
dispatch(setPreset(p <= 0 ? 1 : p));
beats.second.play();
if (!playing) beats.second.play();
};

return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Metronome/TapBpmScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactElement } from "react";
import React, { ReactElement, useEffect } from "react";
import "../../sass/Metronome/TabBpmScreen.scss";

import { useDispatch, useSelector } from "react-redux";
Expand Down
3 changes: 2 additions & 1 deletion src/components/Metronome/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function Metronome(): ReactElement {
useEffect(() => {
const tap = () => {
if (tapBpm.focusMode) {
if (playing) dispatch(stopBeats());
if (tapBpm.startTime) dispatch(incrementTapCount());
else dispatch(startTapBpm());
buttonClick.play();
Expand All @@ -80,7 +81,7 @@ function Metronome(): ReactElement {
return () => {
window.ipcRenderer.off("beats:tap-bpm", tap);
};
}, [dispatch, tapBpm.count, tapBpm.startTime, tapBpm.focusMode]);
}, [dispatch, tapBpm.count, tapBpm.startTime, tapBpm.focusMode, playing]);

let Render: ReactElement;

Expand Down
2 changes: 1 addition & 1 deletion src/store/reducers/metronome.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default (
case ACTION.TOGGLE_TAP_BPM_FOCUS:
return {
...state,
tapBpm: { ...state.tapBpm, focusMode: !state.tapBpm.focusMode },
tapBpm: { ...initialState.tapBpm, focusMode: !state.tapBpm.focusMode },
};
case ACTION.SET_TAP_BPM:
return {
Expand Down

0 comments on commit 2456d86

Please sign in to comment.